Skip to content

Conversation

@hironytic
Copy link
Owner

The beginning of the story is this.

With this PR, logs below ware printed out to console. (I tried it with iPadOS 11.6 on simulator)

When app launches,

[sceneDelegate] sceneWillEnterForeground
<scene> sceneEnterForeground Notification
<app> willEnterForeground Notification
[sceneDelegate] sceneDidBecomeActive
<scene> didActivate Notification
<app> didBecomeActive Notification

Then show app-switcher,

[sceneDelegate] sceneWillResignActive
<scene> willDeactivate Notification
<app> willResignActive Notification

Switch to another app,

[sceneDelegate] sceneDidEnterBackground
<scene> didEnterBackground Notification
<app> didEnterBackground Notification

Switch to this app again,

[sceneDelegate] sceneWillEnterForeground
<scene> sceneEnterForeground Notification
<app> willEnterForeground Notification
[sceneDelegate] sceneDidBecomeActive
<scene> didActivate Notification
<app> didBecomeActive Notification

Show Dock and do "Show All Windows" from dock icon,

[sceneDelegate] sceneWillResignActive
<scene> willDeactivate Notification
<app> willResignActive Notification

Select another scene,

[sceneDelegate] sceneWillEnterForeground
<scene> sceneEnterForeground Notification
[sceneDelegate] sceneDidBecomeActive
<scene> didActivate Notification
<app> didBecomeActive Notification
[sceneDelegate] sceneDidEnterBackground
<scene> didEnterBackground Notification

Summarize the above:

  • Methods in AppDelegate, e.g. applicationDidBecomeActive, was never called.
  • Notifications in UIApplication, e.g. UIApplication.didBecomeActiveNotification was sent!! 😲
  • Notifications in UIScene, e.g. UIScene.didActivateNotification was sent.
  • Note that when switching one scene to another scene in same app, UIApplication.willEnterForegroundNotification and UIApplication.didEnterBackgroundNotification were not sent contrary to that corresponding scene event was sent. ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants