application(_:didFinishLaunchingWithOptions:) is called during prewarming

According to About the App Launch Sequence, application:didFinishLaunchingWithOptions: won't be called during app prewarming on iOS 15. The Objective-C app works as documented.

However, the Swift app behaves differently. application(_:didFinishLaunchingWithOptions:) is called during app prewarming.

I believe this mismatch is an unintentional bug, and it brings a few issues. I can still observe this issue on iOS 15.2. Is there a plan to fix this bug?

Replies

There appears to be different behaviour for apps that use the UIScene life-cycle compared to those that do not.

For apps that do not support scenes, UIApplicationMain() is called and the AppDelegate is initialized, but application:didFinishLaunchingWithOptions: is not called during prewarming.

For apps that do support scenes, application:didFinishLaunchingWithOptions: is called during prewarming, although no scene is created - -[UISceneDelegate scene:willConnectToSession:options:] and other methods are not called.

Hopefully  can confirm whether this is intentional behaviour and make the documentation more accurate.

Post not yet marked as solved Up vote reply of nixx Down vote reply of nixx
  • Thanks for pointing it out. I tried another Swift app, which does not support scenes. As you said, application(_:didFinishLaunchingWithOptions:) is not called during prewarming.

  • Same conculusion with me !

Add a Comment