Additional methods that you use to manage app-specific tasks occurring in a scene.


protocol UIWindowSceneDelegate


Use your UIWindowSceneDelegate object to manage the life cycle of one instance of your app's user interface. The window scene delegate conforms to the UISceneDelegate property, and you use it to receive notifications when its scene connects to the app, enters the foreground, and so on. You also use it to respond to changes in the underlying environment of the scene. For example, if the user resizes a scene, use your delegate to make any needed changes to your content to accommodate the new size.

Do not create UIWindowSceneDelegate objects directly. Instead, specify the name of your delegate class as part of the configuration data for your scene. You can specify this information in your app's Info.plist file, or in the UISceneConfiguration object you return from your app delegate's application(_:configurationForConnecting:options:) method. For more information about how to configure scenes, see Specifying the Scenes Your App Supports.

For an example on using UIWindowSceneDelegate in your app, see Supporting Multiple Windows on iPad.


Managing the Scene's Main Window

var window: UIWindow?

The main window associated with the scene.

Responding to Scene Changes

Performing Tasks

func windowScene(UIWindowScene, userDidAcceptCloudKitShareWith: CKShareMetadata)

Tells the delegate that the window scene now has access to shared information in CloudKit.


Inherits From

See Also

Window Scenes

Supporting Multiple Windows on iPad

Support side-by-side instances of your interface and create a new window with drag and drop.

class UIWindowScene

A specific type of scene that manages one or more windows for your app.

protocol UISceneDelegate

The core methods you use to respond to life-cycle events occurring within a scene.

class UIScene

An object that represents one instance of your app's user interface.