UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } ... }
scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the // UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically // be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are // new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } } func sceneDidDisconnect(_ scene: UIScene) { ...
scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // Use this method to optionally configure and attach the // UIWindow `window` to the provided UIWindowScene `scene`. // If using a storyboard, the `window` property will automatically // be initialized and attached to the scene. // This delegate does not imply the connecting scene or session are // new (see `application:configurationForConnectingSceneSession` instead). guard let _ = (scene as? UIWindowScene) else { return } }
application is about to move from active to inactive state. // This can occur for certain types of temporary interruptions (such as an // incoming phone call or SMS message) or when the user quits the application // and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate // graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate // timers, and store enough application state information to restore your // application to its current state in case it is terminated later. // If your application supports background execution, this method is called // instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { ... var window: UIWindow?
window. When a primary window displays a document, the window typically includes a Back button that lets people navigate to a parent view. In contrast, when an auxiliary window displays a document, the Back button should be replaced with a Done or Close button, because people expect to close an auxiliary window when they're finished working in it. IUUQTEFWFMPQFSBQQMFDPNEFTJHOIVNBOJOUFSGBDFHVJEFMJOFTJPTTZTUFNDBQBCJMJUJFTNVMUJQMFXJOEPXT
w %PDVNFOUBUJPO6*,JU"QQBOE&OWJSPONFOU4DFOFT IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOVJLJUBQQ@BOE@FOWJSPONFOUTDFOFT w )VNBO*OUFSGBDF(VJEFMJOF.VMUJQMF8JOEPXTPOJ1BE IUUQTEFWFMPQFSBQQMFDPNEFTJHOIVNBOJOUFSGBDFHVJEFMJOFTJPTTZTUFNDBQBCJMJUJFTNVMUJQMF XJOEPXT w 4VQQPSUJOH.VMUJQMF8JOEPXTPOJ1BEʢαϯϓϧίʔυʣ IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOVJLJUBQQ@BOE@FOWJSPONFOUTDFOFT TVQQPSUJOH@NVMUJQMF@XJOEPXT@PO@JQBE