Class

UIWindowScene

An instance of your app's user interface that manages one or more windows.

Declaration

class UIWindowScene : UIScene

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 is an object that adopts the UIWindowSceneDelegate protocol. The scene also posts appropriate notifications to registered observers. Use those objects to respond to any changes.

Do not 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 that 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

var windows: [UIWindow]

The windows associated with the scene.

var screen: UIScreen

The screen that displays the contents of the scene.

Getting the Interface Attributes

var traitCollection: UITraitCollection

The traits, such as the size class and scale factor, that describe the current environment of the scene.

var coordinateSpace: UICoordinateSpace

The coordinate space occupied by the scene.

var interfaceOrientation: UIInterfaceOrientation

The orientation to use when displaying content in your windows.

Providing a PDF Version of Your Scene

var screenshotService: UIScreenshotService?

An object that generates screenshots of your app's content.

Destroying a Window Scene

class UIWindowScene.DestructionRequestOptions

An object containing information to use when removing a window scene from your app.

Getting the Status Bar Configuration

var statusBarManager: UIStatusBarManager?

The current configuration of the status bar.

See Also

Scenes

Specifying the Scenes Your App Supports

Tell the system about your app’s scenes, including the objects you use to manage each scene and its initial user interface.

Supporting Multiple Windows on iPad

Use the UIScene lifecycle to support two side-by-side instances of your interface and learn how to create a new window with drag and drop.

protocol UIWindowSceneDelegate

Methods for managing a scene containing an app window.

Beta
protocol UISceneDelegate

Methods you use to respond to life-cycle events occurring within a scene.

Beta
class UIScene

An instance of your app's user interface that's responsible for managing its content separately from other parts of your app.

Beta
class UISceneSession

An object containing information about one of your app's scenes.

Beta
class UISceneConfiguration

Information about the objects and storyboard for UKit to use when creating a particular scene.

Beta
class UISceneActivationConditions

The set of conditions that define when UIKit activates the current scene.

Beta
property list key UIApplicationSceneManifest

The information about the app's scene-based life-cycle support.

Name: Application Scene Manifest
Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software