# IOS App Lifecycle

> Configure AppDelegate, SceneDelegate, deep linking, and background tasks. Use when configuring iOS app lifecycle, deep linking, or background task scheduling.

- Skill: `hoangnguyen0403/ios-app-lifecycle` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds add hoangnguyen0403/ios-app-lifecycle`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hoangnguyen0403/ios-app-lifecycle/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: HoangNguyen0403 (https://skillmd.com/u/hoangnguyen0403)
- Updated: 2026-08-19
- Page: https://skillmd.com/skills/hoangnguyen0403/ios-app-lifecycle

---

# iOS App Lifecycle

## **Priority: P0 (CRITICAL)**

## Implementation Workflow

1. **Configure SceneDelegate** — Use for UI windows and scene-specific state in iOS 13+.
2. **Keep AppDelegate slim** — Focus on app-wide setup (DI, Analytics, Push registration). Move initialization logic to dedicated `Bootstrapper` or `AppCoordinator`.
3. **Handle deep links** — Prefer Universal Links over custom URL schemes. Handle via `scene(_:continue:userActivity:)`. Route through Root Coordinator.
4. **Schedule background tasks** — Use `BGTaskScheduler` for periodic data refresh. Always handle `expirationHandler` to avoid system kill.

See [bootstrapper pattern and background task examples](references/implementation.md)

## Anti-Patterns

- **No Complex AppDelegate Logic**: Delegate to Bootstrapper service
- **No Manual AppDelegate UIWindow**: Use SceneDelegate for iOS 13+
- **No Sync Launch Network**: Move all launch calls to background threads

## References

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