Class

UISceneSession

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

Declaration

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

scene

The scene associated with the current session.

role

The role played by the scene's content.

UISceneSessionRole

Constants indicating the possible roles for a scene.

Getting the Scene Configuration Details

configuration

The configuration data for creating the scene.

Identifying the Scene

persistentIdentifier

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

Getting Additional Session Information

stateRestorationActivity

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

userInfo

Custom attributes that you can associate with the scene.

Relationships

Inherits From

Conforms To

See Also

Configuration

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.

property list key UIApplicationSceneManifest

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

Name: Application Scene Manifest
UISceneConfiguration

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