Hackernoon과 Apple 공식 문서를 바탕으로 학습한 내용을 정리

Link:

Managing Your App's Life Cycle | Apple Developer Documentation

The iOS Application Lifecycle

UIApplicationDelegate

SwiftUI가 나오기 전, App LifeCycle을 검색하면 찾아볼 수 있는 내용들은 모두 UIApplicationDelegate를 기반으로 하고 있다. (이번에 공부를 하면서 UISceneDelegate와 이에 따른 LifeCycle을 알게 되었다.)

UISceneDelegate

SwiftUI가 등장함에 따라 변경된 사항이며, target version이 iOS13 이상부터 사용이 가능하다.

앱이 Scene을 지원한다면, UIKit은 각각의 Scene들에 life-cycle 이벤트를 부여(?)한다. 사용자가 하나의 앱을 multiple scenes를 띄울 수 있기 때문에, scene은 각각의 life cycle을 갖는다. (하나의 앱을 동시에 여러개 띄울 수 있기 때문에 개별적으로 life cycle이 관리된다)

Scene support is an opt-in feature. To enable basic support, add the UIApplicationSceneManifest key to your app’s Info.plist file as described in Specifying the Scenes Your App Supports.

https://developer.apple.com/documentation/uikit/app_and_scenes/specifying_the_scenes_your_app_supports