---
title: "init(_:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/uiapplicationdelegateadaptor/init(_:)-59sfu"
---

# init(_:)

Creates a UIKit app delegate adaptor.

## Declaration

```swift
@MainActor @preconcurrency init(_ delegateType: DelegateType.Type = DelegateType.self)
```

## Parameters

- `delegateType`: The type of application delegate that you define in your app, which conforms to the doc://com.apple.documentation/documentation/UIKit/UIApplicationDelegate protocol.

## Discussion

Discussion Call this initializer indirectly by creating a property with the UIApplicationDelegateAdaptor property wrapper from inside your App declaration: @main struct MyApp: App {     @UIApplicationDelegateAdaptor private var appDelegate: MyAppDelegate

var body: some Scene { ... } } SwiftUI initializes the delegate and manages its lifetime, calling upon it to handle application delegate callbacks. If you want SwiftUI to put the instantiated delegate in the Environment, make sure the delegate class also conforms to the ObservableObject protocol. That causes SwiftUI to invoke the init(_:) initializer rather than this one.
