I wrote an app that can show live streaming. When using iPad, I can connect an external display and move app to display, that I can do what I want on my iPad and watch live streaming on external display using cable.
But app moving to display is not always full screen, and on some displays it shows larger than the external display range that I should go to Settings -> Display & Brightness -> External Display -> Switching "Allow Display Mode Changes" to fix this issue.
Are there APIs to make the App "move to display" programmatically, keep app full-screen, matching the external display's resolution on the External display?
Are there APIs to make the App "move to display" programmatically
There are no APIs to move your interactive windowApplication
roles scenes to the external display programmatically.
There are situations, though, where your application will be offered a windowExternalDisplayNonInteractive
role scene, such as when your application is the primary app on the embedded display. If you place content in that scene by creating a UIWindow
there, your content will be full screen on the external display.
Note that this is a non-interactive scene so you cannot move the system pointer to that scene or have content in that scene receive keyboard input. That can work fine for some situations, like a game party mode, but we usually recommend folks start with a normal windowApplication
role scene as that provides more options to users.
For more information on windowExternalDisplayNonInteractive
role scenes, see this article:
https://developer.apple.com/documentation/uikit/windows_and_screens/presenting_content_on_a_connected_display
matching the external display's resolution on the External display?
The same article provides some detail on setting the mode of the UIScreen
(which you can get from either your UIWindow
or UIWindowScene
instances):
https://developer.apple.com/documentation/uikit/windows_and_screens/presenting_content_on_a_connected_display#4030186