Class

UIScene.ConnectionOptions

A data object containing information about the reasons why UIKit created the scene.

Declaration

class ConnectionOptions : NSObject

Overview

UIKit creates scenes for many reasons. It might do so in response to a Handoff request or a request to open a URL. When there is a specific reason for creating a scene, UIKit fills a UIScene.ConnectionOptions object with the associated data and passes it to your delegate at connection time. Use the information in this object to respond accordingly. For example, open the URLs that UIKit provides, and display their contents in the scene.

Do not create UIScene.ConnectionOptions objects directly. UIKit creates UIScene.ConnectionOptions objects for you and passes them to the scene(_:willConnectTo:options:) method of your scene delegate.

Topics

Restoring the Scene's Previous State

var userActivities: Set<NSUserActivity>

The user activity information for restoring your app to its previous state.

Handling Quick Actions

var shortcutItem: UIApplicationShortcutItem?

The user-selected action to perform.

Opening URLs

var urlContexts: Set<UIOpenURLContext>

The URLs to open, along with metadata specifying how to open them.

Responding to a Handoff Request

var handoffUserActivityType: String?

The type of the pending Handoff activity.

Accepting a CloudKit Share

var cloudKitShareMetadata: CKShareMetadata?

Information about the CloudKit data that is now available to the app.

Responding to Notifications

var notificationResponse: UNNotificationResponse?

The user's response to one of your app's notifications.

Getting the Source App

var sourceApplication: String?

The bundle ID of the app that originated the request.

Relationships

Inherits From

Conforms To

See Also

Connecting and Disconnecting the Scene

func scene(UIScene, willConnectTo: UISceneSession, options: UIScene.ConnectionOptions)

Tells the delegate about the addition of a scene to the app.

func sceneDidDisconnect(UIScene)

Tells the delegate that UIKit removed a scene from your app.