I have a whiteboard app that when connected to an external screen just shows the whiteboard portion of the screen instead of the entire app screen that includes the various pen tools, etc. When the notification for a second screen is received a second view controller that contains just a UIImage for displaying the whiteboard is created and then whenever the document is updated and a second screen is connected that UIImage is also updated (in addition to the main view on the actual iPad).
I don't understand how to support this with the UIWindowSceneDelegate. I have the multi-window working but only the mirror image of the entire iPad image is shown on the second screen. I tried setting up a second SceneDelegate in the Info.plist file as shown below.
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleExternalDisplay</key>
<array>
<dict>
<key>UISceneClassName</key>
<string></string>
<key>UISceneDelegateClassName</key>
<string>External Display Configuration</string>
<key>UISceneConfigurationName</key>
<string>reDraw.ExternalSceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>ExternalScreen</string>
</dict>
</array>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>reDraw.SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>MainDocumentBrowser</string>
</dict>
</array>
</dict>
</dict>
But I can't figure out what to do differently for the external screen. The scene delegate for the main screen uses the UIDocumentBrowserViewController.presentDocument method to open the document.
It doesn't make sense to me to open the document a second time for the external screen. Any help or pointers to code samples would be appreciated.