Describe the app and UIViewController lifecycle.
The application
States: Not running → Inactive → Active → Background → Suspended. Since iOS 13 the foreground/background transitions belong to the scene (UIWindowSceneDelegate), while launch and system events go to UIApplicationDelegate:
application(_:didFinishLaunchingWithOptions:)— the process started, set up services.scene(_:willConnectTo:options:)— create theUIWindow, handle a URL/push fromconnectionOptions.sceneWillEnterForeground→sceneDidBecomeActive— refresh data, resume work.sceneWillResignActive→sceneDidEnterBackground— pause, save state (the next step may be Suspended and eviction without callbacks).sceneDidDisconnect— the scene was closed (a window on iPad), release resources.
In SwiftUI the same phases are read through @Environment(\.scenePhase). Per TN3187, after iOS 26 apps without scenes will not launch.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep