<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISceneDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISceneDelegate"
  },
  "title" : "UISceneDelegate"
}
-->

# UISceneDelegate

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

```
@MainActor protocol UISceneDelegate : NSObjectProtocol
```

## Overview

Use your [`UISceneDelegate`](/documentation/UIKit/UISceneDelegate) object to manage life-cycle events in one instance of your app’s user interface. This interface defines methods for responding to state transitions that affect the scene, including when the scene enters the foreground and becomes active, and when it enters the background. Use your delegate to provide appropriate behavior when these transitions occur. For example, finish critical tasks and quiet your app when it enters the background.

Don’t create [`UISceneDelegate`](/documentation/UIKit/UISceneDelegate) objects directly. Instead, specify the name of your custom delegate class as part of the configuration data for your scenes. You can specify this information in your app’s `Info.plist` file, or in the [`UISceneConfiguration`](/documentation/UIKit/UISceneConfiguration) object you return from your app delegate’s [`application(_:configurationForConnecting:options:)`](/documentation/UIKit/UIApplicationDelegate/application(_:configurationForConnecting:options:)) method. For more information about how to configure scenes, see [Specifying the scenes your app supports](/documentation/UIKit/specifying-the-scenes-your-app-supports).

## Topics

### Working with window scenes

[Supporting multiple windows on iPad](/documentation/UIKit/supporting-multiple-windows-on-ipad)

Support side-by-side instances of your app’s interface and create new windows.

### Connecting and disconnecting the scene

[`-  scene:willConnectToSession:options:`](/documentation/UIKit/UISceneDelegate/scene(_:willConnectTo:options:))

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

[`-  sceneDidDisconnect:`](/documentation/UIKit/UISceneDelegate/sceneDidDisconnect(_:))

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

[`ConnectionOptions`](/documentation/UIKit/UIScene/ConnectionOptions)

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

### Transitioning to the foreground

[`-  sceneWillEnterForeground:`](/documentation/UIKit/UISceneDelegate/sceneWillEnterForeground(_:))

Tells the delegate that the scene is about to begin running in the foreground and become visible to the user.

[`-  sceneDidBecomeActive:`](/documentation/UIKit/UISceneDelegate/sceneDidBecomeActive(_:))

Tells the delegate that the scene became active and is now responding to user events.

### Transitioning to the background

[`-  sceneWillResignActive:`](/documentation/UIKit/UISceneDelegate/sceneWillResignActive(_:))

Tells the delegate that the scene is about to resign the active state and stop responding to user events.

[`-  sceneDidEnterBackground:`](/documentation/UIKit/UISceneDelegate/sceneDidEnterBackground(_:))

Tells the delegate that the scene is running in the background and is no longer onscreen.

### Opening URLs

[`-  scene:openURLContexts:`](/documentation/UIKit/UISceneDelegate/scene(_:openURLContexts:))

Asks the delegate to open one or more URLs.

### Continuing user activities

[`-  scene:willContinueUserActivityWithType:`](/documentation/UIKit/UISceneDelegate/scene(_:willContinueUserActivityWithType:))

Tells the delegate that it’s about to receive Handoff-related data.

[`-  scene:continueUserActivity:`](/documentation/UIKit/UISceneDelegate/scene(_:continue:))

Tells the delegate to handle the specified Handoff-related activity.

[`-  scene:didFailToContinueUserActivityWithType:error:`](/documentation/UIKit/UISceneDelegate/scene(_:didFailToContinueUserActivityWithType:error:))

Tells the delegate that the activity couldn’t be continued.

### Saving the state of the scene

[Restoring your app’s state](/documentation/UIKit/restoring-your-app-s-state)

Provide continuity for the user by preserving current activities.

[`-  stateRestorationActivityForScene:`](/documentation/UIKit/UISceneDelegate/stateRestorationActivity(for:))

Returns a user activity object encapsulating the current state of the specified scene.

[`-  scene:restoreInteractionStateWithUserActivity:`](/documentation/UIKit/UISceneDelegate/scene(_:restoreInteractionStateWith:))

[`-  scene:didUpdateUserActivity:`](/documentation/UIKit/UISceneDelegate/scene(_:didUpdate:))

Tells the delegate that the specified activity object was updated.

## Relationships

### Inherited By

[`UIWindowSceneDelegate`](/documentation/UIKit/UIWindowSceneDelegate)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)