Agent Skills: iOS App Lifecycle

Manage AppDelegate, SceneDelegate, deep linking, and background tasks. Use when configuring iOS app lifecycle, deep linking, or background task scheduling. (triggers: AppDelegate.swift, SceneDelegate.swift, didFinishLaunchingWithOptions, willConnectTo, backgroundTask, Shortcut, UserActivity)

UncategorizedID: hoangnguyen0403/agent-skills-standard/ios-app-lifecycle

Install this agent skill to your local

pnpm dlx add-skill https://github.com/HoangNguyen0403/agent-skills-standard/tree/HEAD/skills/ios/ios-app-lifecycle

Skill Files

Browse the full folder contents for ios-app-lifecycle.

Download Skill

Loading file tree…

skills/ios/ios-app-lifecycle/SKILL.md

Skill Metadata

Name
ios-app-lifecycle
Description
"Manage AppDelegate, SceneDelegate, deep linking, and background tasks. Use when configuring iOS app lifecycle, deep linking, or background task scheduling. (triggers: AppDelegate.swift, SceneDelegate.swift, didFinishLaunchingWithOptions, willConnectTo, backgroundTask, Shortcut, UserActivity)"

iOS App Lifecycle

Priority: P0

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 a dedicated Bootstrapper or AppCoordinator.
  3. Handle deep links — Prefer Universal Links over custom URL schemes. Handle via scene(_:continue:userActivity:). Route through the 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

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

References