Ios App Lifecycle
ASecurityUse `SceneDelegate` as the main entry point for UI lifecycle on iOS 13+, and keep `AppDelegate` focused on app-wide setup only. - In `SceneDelegate`, create the `UIWindow`, attach it to the `UIWindowScene`, and start your root coordinator there. - In `AppDelegate`, keep `application(_:didFinishLaunchingWithOptions:)` slim by delegating dependency registration, analytics setup, and push registration to a dedicated `AppBootstrapper`. - For deep links, prefer Universal Links and handle them thro...
- 584 stars
- 0 votes
- 0 copies
- 3 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 12 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill ios-app-lifecycle --agent claude-codeAre you the author of Ios App Lifecycle?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-ios-app-lifecycle-agent-skills-standard)Use `SceneDelegate` as the main entry point for UI lifecycle on iOS 13+, and keep `AppDelegate` focused on app-wide setup only.
- In `SceneDelegate`, create the `UIWindow`, attach it to the `UIWindowScene`, and start your root coordinator there.
- In `AppDelegate`, keep `application(_:didFinishLaunchingWithOptions:)` slim by delegating dependency registration, analytics setup, and push registration to a dedicated `AppBootstrapper`.
- For deep links, prefer Universal Links and handle them through `scene(_:continue:userActivity:)`, then route into your coordinator instead of putting navigation logic directly in the delegate.
- For background work, use `BGTaskScheduler`, register tasks once at launch, and always set an `expirationHandler` so the system can safely stop unfinished work.
- Avoid synchronous network calls during launch, heavy logic in `AppDelegate`, or manually managing the main window from `AppDelegate` on modern iOS.
Example structure:
```swift
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
AppBootstrapper().configure()
registerBackgroundTasks()
return true
}
}
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var appCoordinator: AppCoordinator?
func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
guard let windowScene = scene as? UIWindowScene else { return }
let window = UIWindow(windowScene: windowScene)
let nav = UINavigationController()
let coordinator = AppCoordinator(nav: nav)
coordinator.start()
window.rootViewController = nav
self.window = window
self.appCoordinator = coordinator
window.makeKeyAndVisible()
}
}
```
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
- trigger-5.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.