Class

UIWindowScene

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

Declaration

@interface 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:configurationForConnectingSceneSession: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

windows

The windows associated with the scene.

screen

The screen that displays the contents of the scene.

Getting the Interface Attributes

traitCollection

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

coordinateSpace

The coordinate space occupied by the scene.

interfaceOrientation

The orientation to use when displaying content in your windows.

sizeRestrictions

The minimum and maximum size of the app's windows.

UISceneSizeRestrictions

An object that specifies the minimum and maximum sizes for resizable windows.

Providing a PDF Version of Your Scene

screenshotService

An object that generates a high-fidelity version of your app's content.

Getting the Status Bar Configuration

statusBarManager

The current configuration of the status bar.

Configuring a Window's Title Bar

titlebar

The title bar displayed in a window of a Mac app.

UITitlebar

An object that you use to configure the title bar of a window in a Mac app built with Mac Catalyst.

Relationships

Inherits From

See Also

Window Scenes

UIWindowSceneDelegate

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

UISceneDelegate

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

UIScene

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