管理应用程序的生命周期
概览
When your app’s state changes, UIKit notifies you by calling methods of the appropriate delegate object:
(当您的应用程序状态发生变化是,UIKit会调用适当的委托对象的方法通知您。)
- In iOS 13 and later, use UISceneDelegate objects to respond to life-cycle events in a scene-based app.
(在 iOS 13 及更高版本中,使用UISceneDelegate对象来响应基于场景的应用程序中的生命周期。) - In iOS 12 and earlier, use the UIApplicationDelegate object to respond to life-cycle events.
(iOS 12和更早版本中,使用UIApplicationLegate对象来响应生命周期事件。)
响应基于场景的生命周期事件
如果您的应用程序支持场景,UIKit会为每个场景提供单独的生命周期事件。场景表示应用程序在设备上运行的UI界面的一个实例。用户可以为每个应用程序创建多个场景,并分