---
title: "init(hostingDelegateClass:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uiscenesessionactivationrequest-swift.struct/init(hostingdelegateclass:)"
---

# init(hostingDelegateClass:)

Creates a UISceneSessionActivationRequest customized to open a SwiftUI scene.

## Declaration

```swift
init?<D>(hostingDelegateClass: D.Type) where D : UIHostingSceneDelegate
```

## Parameters

- `hostingDelegateClass`: A Class type that conforms to UIHostingSceneDelegate.

## Discussion

Discussion The first scene declared in the rootScene property of your hosting delegate class will be activated by this request. class HostingSceneDelegate: UIHostingSceneDelegate {     static var rootScene: some Scene {         WindowGroup() {             ContentView()         }     } }

let request = UISceneSessionActivationRequest(     hostingDelegateClass: HostingSceneDelegate.self ) UIApplication.shared.activateSceneSession(for: request) When a UIScene is activated using this request object, its configuration is managed by SwiftUI. You will not see a call to your app delegate’s application(_:configurationForConnecting:options:) method. An instance of the provided hosting delegate class will be created by SwiftUI and receive lifecycle callbacks for the associated scene.
