Class

UISceneSession

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

Declaration

class UISceneSession : NSObject

Overview

A UISceneSession object manages a unique runtime instance of your scene. When the user adds a new scene to your app, or when you request one programmatically, the system creates a session object to track that scene. The session contains a unique identifier and the configuration details of the scene. UIKit maintains the session information for the lifetime of the scene itself, destroying the session in response to the user closing the scene in the app switcher.

You do not create session objects directly. UIKit creates sessions in response to user interactions with your app. You can also ask UIKit to create a new scene and session programmatically by calling the requestSceneSessionActivation(_:userActivity:options:errorHandler:) method of UIApplication. UIKit initializes the session with default configuration data based on the contents of your app's Info.plist file.

Topics

Getting the Scene Information

var scene: UIScene?

The scene associated with the current session.

var role: UISceneSession.Role

The role played by the scene's content.

struct UISceneSession.Role

Constants indicating the possible roles for a scene.

Getting the Scene Configuration Details

var configuration: UISceneConfiguration

The configuration data for creating the scene.

Identifying the Scene

var persistentIdentifier: String

A unique identifier that persists for the lifetime of the session.

Getting Additional Session Information

var stateRestorationActivity: NSUserActivity?

An activity object you can use to restore the previous contents of your scene's interface.

var userInfo: [String : Any]?

Custom attributes that you can associate with the scene.

Relationships

Inherits From

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

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

Beta
protocol UISceneDelegate

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

Beta
class UIWindowScene

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

Beta
class UIScene

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

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