iOS App Lifecycle
Priority: P0
Implementation Workflow
- Configure SceneDelegate — Use for UI windows and scene-specific state in iOS 13+.
- Keep AppDelegate slim — Focus on app-wide setup (DI, Analytics, Push registration). Move initialization logic to a dedicated
BootstrapperorAppCoordinator. - Handle deep links — Prefer Universal Links over custom URL schemes. Handle via
scene(_:continue:userActivity:). Route through the Root Coordinator. - Schedule background tasks — Use
BGTaskSchedulerfor periodic data refresh. Always handleexpirationHandlerto avoid system kill.
See bootstrapper pattern and background task examples
Anti-Patterns
- ❌ Complex logic in
didFinishLaunchingWithOptions— delegate to a Bootstrapper service - ❌ UIWindow setup in AppDelegate — use SceneDelegate for iOS 13+
- ❌ Synchronous network calls during launch — move to background thread