Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Don't merge] Try to receive life-cycle notifications #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant