# IOS App Lifecycle

> Standards for AppDelegate, SceneDelegate, Deep Linking, and Background Tasks. Use when managing iOS app lifecycle, deep linking, or background task scheduling. (triggers: AppDelegate.swift, SceneDelegate.swift, didFinishLaunchingWithOptions, willConnectTo, backgroundTask, Shortcut, UserActivity)

- Skill: `comeonoliver/ios-app-lifecycle` (Agent Skill)
- Install (CLI): `npx skillmds@latest add comeonoliver/ios-app-lifecycle`
- Raw SKILL.md: https://api.skillmd.com/api/skills/comeonoliver/ios-app-lifecycle/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ComeOnOliver (https://skillmd.com/u/comeonoliver)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/comeonoliver/ios-app-lifecycle

---


# iOS App Lifecycle Standards

## **Priority: P0**

## Implementation Guidelines

### App & Scene Delegate

- **SceneDelegate**: Use for UI windows and scene-specific state in iOS 13+.
- **AppDelegate**: Focus on app-wide setup (DI, Analytics, Push notification registration).
- **Slim Delegates**: Move initialization logic to dedicated `Bootstrapper` or `AppCoordinator`.

### Deep Linking

- **Universal Links**: Prefer over custom URL schemes. Handle via `scene(_:continue:userActivity:)`.
- **Handling logic**: Routing should be handled by the Root Coordinator to navigate to specific screens.

### Background Tasks

- **Background Fetch**: Use `BGTaskScheduler` for periodically refreshing data.
- **Expiration**: Handle `expirationHandler` to avoid app kill by the system.

## Anti-Patterns

- **No complex logic in didFinishLaunching**: Use a Bootstrapper service.
- **No UIWindow setup in AppDelegate**: Use SceneDelegate for iOS 13+.
- **No synchronous network calls in launch**: Move to background thread.

## References

- [Lifecycle & Background Tasks](references/implementation.md)


