Contents

UIWindowScene

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

Declaration

@MainActor class UIWindowScene

Mentioned in

Overview

A UIWindowScene object manages one instance of your app’s UI, including one or more windows that you display from that scene. The scene object manages the display of your windows on the user’s device, and the life cycle of that scene as the user interacts with it. When the state of the scene changes, the scene object notifies its delegate object, which adopts the UIWindowSceneDelegate protocol. The scene also posts appropriate notifications to registered observers. Use the delegate object or notification observers to respond to any changes.

Don’t create window scene objects directly. Instead, specify that you want a UIWindowScene object at configuration time by including the class name for the scene in the scene configuration details of your app’s Info.plist file. You can also specify the class name when creating a UISceneConfiguration object in your app delegate’s application(_:configurationForConnecting:options:) method. When the user interacts with your app, the system creates an appropriate scene object based on the configuration data you provided. To create a scene programmatically, call the requestSceneSessionActivation(_:userActivity:options:errorHandler:) method of UIApplication.

Topics

Getting the active windows

Getting the interface attributes

Observing trait changes

Overriding trait values

Providing a PDF version of your scene

Sharing content

Determining window behaviors

Working with window geometry

Working with focus

Getting the status bar configuration

Configuring a window’s title bar

Configuring the windowing control style

Supporting types

Deprecated symbols

See Also

Window scenes