Daily iOS
App lifecycle and system

Scene-based app lifecycle

In a scene-based iOS app, where would you put work like registering the push token, and where would you put work like saving screen state: AppDelegate or SceneDelegate?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Work that happens once per process, such as getting the push token, handling launch options, and initializing SDKs, goes in AppDelegate, and work that happens per window, such as saving and restoring the screen across active and inactive transitions and stopping timers, goes in SceneDelegate (or scenePhase in SwiftUI).

Share a question