diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/ContentView.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/ContentView.swift index c8aa72fa2..9267c942c 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/ContentView.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/ContentView.swift @@ -105,6 +105,8 @@ struct ContentView: View { } } } + + Text("SDK Version: arsenal_46627_FULL_20241022_0154_394587") } .listStyle(GroupedListStyle()) .navigationTitle("Agora API Example") diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/ARKit/ARKit.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/ARKit/ARKit.swift index e8f41557a..f9c9cc2aa 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/ARKit/ARKit.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/ARKit/ARKit.swift @@ -96,12 +96,20 @@ struct ARKit: View { @State private var statsInfo: String = "" @ObservedObject private var agoraKit = ARKitRTC() - @GestureState private var tappedLocation: CGPoint = .zero - + @State var tappedLocation: CGPoint = .zero + @State var dragLocation: CGPoint = .zero + let sceneView = ARViewWrapper() var body: some View { VStack { + let tap = TapGesture().onEnded { + tappedLocation = dragLocation + agoraKit.doSceneViewTapped(tappedLocation) + } + let drag = DragGesture(minimumDistance: 0).onChanged { value in + dragLocation = value.location + }.sequenced(before: tap) sceneView .adaptiveBackground().alert(isPresented: $agoraKit.isSupportedAR) { let message = "This app requires world tracking, which is available only on iOS devices with the A9 processor or later.".localized @@ -115,13 +123,8 @@ struct ARKit: View { }).onReceive(agoraKit.$isHiddenStatsLabel, perform: { _ in sceneView.statsLabel.isHidden = agoraKit.isHiddenStatsLabel sceneView.statsLabel.text = agoraKit.stats - }).onTapGesture { - agoraKit.doSceneViewTapped(tappedLocation) - }.gesture(DragGesture(minimumDistance: 0) - .updating($tappedLocation) { (value, state, _) in - state = value.startLocation - } - ) + }) + .gesture(drag) }.onAppear(perform: { agoraKit.setupRTC(configs: configs, diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/KtvCopyrightMusic/KtvCopyrightMusic.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/KtvCopyrightMusic/KtvCopyrightMusic.swift index 2c62d1903..dfef92c14 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/KtvCopyrightMusic/KtvCopyrightMusic.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/KtvCopyrightMusic/KtvCopyrightMusic.swift @@ -11,7 +11,8 @@ struct KtvCopyrightMusic: View { var body: some View { ZStack { Button("Ktv copyright music".localized) { - let urlString = "https://doc.shengwang.cn/doc/online-ktv/ios/implementation/ktv-scenario/integrate-ktvapi" + let urlString = "https://doc.shengwang.cn/doc/online-ktv/ios/ktv-scenario/get-started/integrate-ktvapi" + if let url = URL(string: urlString) { UIApplication.shared.open(url) } diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudio.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudio.swift index 1a00342e4..d15a8f2af 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudio.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudio.swift @@ -299,7 +299,6 @@ struct ActionSheetView: View { } }.padding(.horizontal, 15) }.frame(height: 200) - .adaptiveBackground(Color.white) .offset(x: 0, y: isShow ? 200 : 0) } } diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudioRTC.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudioRTC.swift index f24150bfc..f0ee60546 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudioRTC.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/SpatialAudio/SpatialAudioRTC.swift @@ -126,7 +126,7 @@ class SpatialAudioRTC: NSObject, ObservableObject { if isVoice1 { _ = isMute ? mediaPlayer1.pause() : mediaPlayer1.resume() } else { - _ = isMute ? mediaPlayer1.pause() : mediaPlayer1.resume() + _ = isMute ? mediaPlayer2.pause() : mediaPlayer2.resume() } } func mediaPlayerVoiceBlur(isVoice1: Bool, isOn: Bool) { @@ -135,7 +135,7 @@ class SpatialAudioRTC: NSObject, ObservableObject { if isVoice1 { mediaPlayer1.setSpatialAudioParams(params) } else { - mediaPlayer1.setSpatialAudioParams(params) + mediaPlayer2.setSpatialAudioParams(params) } } func mediaPlayerAirborne(isVoice1: Bool, isOn: Bool) { @@ -144,7 +144,7 @@ class SpatialAudioRTC: NSObject, ObservableObject { if isVoice1 { mediaPlayer1.setSpatialAudioParams(params) } else { - mediaPlayer1.setSpatialAudioParams(params) + mediaPlayer2.setSpatialAudioParams(params) } } func mediaPlayerAttenuation(isVoice1: Bool, value: Float) {