Class

UIScene

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

Declaration

@interface UIScene : UIResponder

Overview

UIKit creates a scene object for each instance of your app's UI that the user or your app requests. Typically, UIKit creates a UIWindowScene object instead of a UIScene object, but you use the methods and properties of this class to access information about a scene.

Every scene object has an associated delegate object, an object that adopts the UISceneDelegate protocol. When the state of the scene changes, the scene object notifies its delegate object and posts appropriate notifications to registered observer objects. Use the delegate object and notifications to respond to changes in the state of the scene. For example, use it to determine when your scene moves to the background.

You do not create scene objects directly. You can programmatically ask UIKit to create a scene object for your app by calling the requestSceneSessionActivation:userActivity:options:errorHandler: method of UIApplication. UIKit also creates scenes in response to user interactions. When configuring your app's scene support, specify UIWindowScene objects instead of UIScene objects.

Topics

Creating a Scene Object

- initWithSession:connectionOptions:

Creates a scene object using the specified session and connection information.

Managing the Life Cycle of a Scene

delegate

The object you use to receive life-cycle events associated with the scene.

UISceneDelegate

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

Getting the Scene Attributes

activationState

The current execution state of the scene.

UISceneActivationState

Constants indicating the foreground or background execution state of your app.

title

A user-visible string you supply to help users differentiate among your app's scenes.

Specifying the Scene's Activation Conditions

activationConditions

The conditions that define when UIKit activates the scene object.

Responding to Life Cycle Notifications

UISceneWillConnectNotification

A notification indicating that UIKit added a scene to your app.

UISceneDidDisconnectNotification

A notification indicating that UIKit removed a scene from your app.

UISceneWillEnterForegroundNotification

A notification indicating that a scene is about to begin running in the foreground and become visible to the user.

UISceneDidActivateNotification

A notification indicating that the scene is now onscreen and responding to user events.

UISceneWillDeactivateNotification

A notification indicating that the scene is about to resign the active state and stop responding to user events.

UISceneDidEnterBackgroundNotification

A notification indicating that the scene is running in the background and is no longer onscreen.

Getting the Scene's Session

session

The session associated with the scene.

Opening URLs

- openURL:options:completionHandler:

Attempts to open the resource at the specified URL asynchronously.

Relationships

Inherits From

See Also

Window Scenes

UIWindowSceneDelegate

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

Beta
UIWindowScene

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

Beta
UISceneDelegate

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

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