Unable to get external display working

Trying to get my iPad app to display a different view on connected external display. Info.plist is setup as follows:

<dict>
	<key>UIApplicationSceneManifest</key>
	<dict>
		<key>UIApplicationSupportsMultipleScenes</key>
		<true/>
		<key>UISceneConfigurations</key>
		<dict>
			<key>UIWindowSceneSessionRoleExternalDisplayNonInteractive</key>
			<array>
				<dict>
					<key>UISceneConfigurationName</key>
					<string>External Display</string>
					<key>UISceneDelegateClassName</key>
					<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
				</dict>
			</array>
		</dict>
	</dict>
</dict>

I have my SceneDelegate setup as the follows:

import SwiftUI

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    var window: UIWindow?
 
    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = scene as? UIWindowScene else { return }
 
        if session.role == .windowExternalDisplayNonInteractive {
            let window = UIWindow(windowScene: windowScene)
            window.rootViewController = UIHostingController(rootView: ExternalDisplayView())
            self.window = window
            window.makeKeyAndVisible()
        }
    }
}

A good starting point to learn how to configure your project for scenes is: Presenting content on a connected display. Please review the article and apply the learnings to your project.

Unable to get external display working
 
 
Q