最佳答案
这就是我要找的控件:https://developer.apple.com/documentation/avkit/avroutepickerview .它在屏幕上显示为一个按钮(带有默认的 AirPlay 2 图标)并为您处理所有逻辑。
例子
import AVKit
let audioPicker = AVRoutePickerView(frame: ...)
addSubview(audioPicker)
您可以通过以下方式订阅音频路由更新:
NotificationCenter.default.addObserver(self, selector: ...), name: AVAudioSession.routeChangeNotification, object: nil)
关于ios - 在应用程序内打开 native iOS 音频输出目标选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54933638/