<!--
{
  "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/scene(_:willConnectTo:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UISceneDelegate(im)scene:willConnectToSession:options:"
  },
  "title" : "scene(_:willConnectTo:options:)"
}
-->

# scene(_:willConnectTo:options:)

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

```
optional func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)
```

## Parameters

`scene`

The scene object being connected to your app.

`session`

The session object containing details about the scene’s configuration.

`connectionOptions`

Additional options for configuring the scene. Use the information in this object to handle actions that caused the creation of the scene, for example, to respond to a quick action selected by the user.

## Discussion

This method is called when your app creates or restores an instance of your user interface.

When the user or your app requests a new instance of your user interface, UIKit creates an appropriate scene object and connects it to your app. Use this method to respond to the addition of the new scene and to begin loading any data that the scene needs to display.

When your app responds to scene activations requests, for example, by using [`requestSceneSessionActivation(_:userActivity:options:errorHandler:)`](/documentation/UIKit/UIApplication/requestSceneSessionActivation(_:userActivity:options:errorHandler:)), the user activity is in the [`userActivities`](/documentation/UIKit/UIScene/ConnectionOptions/userActivities) set provided by options.

When the user reactivates an instance of your user interface, UIKit creates a scene object and populates it with saved state, provided by  [`stateRestorationActivity(for:)`](/documentation/UIKit/UISceneDelegate/stateRestorationActivity(for:)). When your app restores state, the user activity is presented in the [`stateRestorationActivity`](/documentation/UIKit/UISceneSession/stateRestorationActivity) property of session.

In addition to calling this method, UIKit also posts a [`willConnectNotification`](/documentation/UIKit/UIScene/willConnectNotification) notification.

## Topics

### 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.



---

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)