Posts

Post not yet marked as solved
0 Replies
817 Views
I am working on an app, which will show additional content on an external display. Currently, I am using the following in AppDelegate to set up an additional scene, which uses its own view hierarchy:func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { let configuration = UISceneConfiguration(name: "Default Configuration", sessionRole: .windowExternalDisplay) configuration.delegateClass = ExtSceneDelegate.self return configuration }This works well, but only when the user connects by going into the Control Center, selecting Screen Mirroring, and choosing an Apple TV to mirror to. This is unintuitive, and I would much prefer to allow the user to connect from within the app, using an AVRoutePickerView or something similar. Unfortunately, this method, as well as selecting the TV from the Now Playing menu in Control Center triggers a different form of AirPlay, which only shows AVPlayer content.I have tried following this article [https://developer.apple.com/documentation/uikit/windows_and_screens/displaying_content_on_a_connected_screen], but parts of the code are deprecated as of iOS 13, and the notifications described are only being sent when the user connects via Control Center Screen Mirroring, not when an AVRoutePicker is used within the app.Is there any way to display the Screen Mirroring picker view from within my app (e.g. by tapping a UIButton)? Alternatively, is there a way to use the standard AirPlay to display a separate scene on the connected screen?Thank you in advance,Ian
Posted
by icostello.
Last updated
.