Skip to content

[ios] migrate AppDelegate methods to SceneDelegate #170178

Open
@hellohuanlin

Description

@hellohuanlin

Use case

After adopting SceneDelegate, several AppDelegate methods are not call anymore. But instead, corresponding SceneDelegate methods will be called.

Verified not called on app delegate, but called on scene delegate:

- sceneWillEnterForeground:
- sceneDidBecomeActive:
- sceneWillResignActive:
- sceneDidEnterBackground:

Unverified but possibly similar behavior as above:

- scene:willContinueUserActivityWithType:
- scene:continueUserActivity:
- scene:didFailToContinueUserActivityWithType:error:

- stateRestorationActivityForScene:
- scene:restoreInteractionStateWithUserActivity:
- scene:didUpdateUserActivity:

I suspect the above list will be similar behavior (unverified), because the pattern here seems to be that, as long as there's a similar function in SceneDelegate, then it will replace the corresponding function in AppDelegate.

Also note these UIApplication notifications are still working:

  • didFinishLaunchingNotification
  • didBecomeActiveNotification
  • didEnterBackgroundNotification

Proposal

We should migrate those methods over to scene delegate.

Side note: app delegate could be deprecated in the future from some sources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions