Issue:
I find some unexpected behavior regarding the AppDelegate method application(_:configurationForConnecting:options:)
.
The documentation states:
UIKit calls this method shortly before creating a new scene.
I would expect that this is the case every time the app is launched.
The method is indeed called when I launch my app for the first time, however for all subsequent launches, it is not.
Reproduce:
I have a very simple test case to reproduce:
- Xcode 12 > Create new Project > iOS > App (UIKit/Storyboard)
- add a debugging statement in the method in
AppDelegate
like so:// from Apple's sample project: func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. print("I was called!"). // <--- debugging statement return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) }
- run the app > "I was called!" gets printed in the console
- run the app again > nothing get's printed.
Question:
Why is application(_:configurationForConnecting:options:)
not being called on second launch?
(Is it expected behavior, if yes why / Is it a bug by Apple)