I'm running on Catalina Beta 2 and using Xcode 11 Beta 2. I've created and built the default template SwiftUI project and it loads fine. I then opened a small project I created in Xcode 10 using storyboards and copy-n-pasted the setup from Apple's template project.
Everything looks the same across the app, Info.plist, settings, app delegate, scene delegate etc and I've gone over it many times looking to see what's wrong.
Here is my current app delegate:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
let config = UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
return config // <<<<< Breakpoint !!!!
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}
}
In Apples template project this works, but in mine it doesn't.
Stopping at the breakpoint in mine I can see that the connectingSceneSession
and loaded config have ignored the scene details in the Info.plist
. Instead a default config is created with a nil scene delegate and the role of an external display.
The really weird thing is that if I execute:
po UISceneConfiguration(name: "Default Configuration", sessionRole: .applicationWindow)
In the debug console, then it loads up the scene from the Info.plist
exactly as I would expect.
The core of the problem seems to be that the app is failing see the definition of the scene in the Info.plist
and returning a new external display scene instead. Even after I tried replacing the app's Info.plist
with the one from Apple's example app.
Anyone got any idea what might be going on?