If your app needs to use traditional App Delegate methods for these types of lifecycle events, you can use the NSApplicationDelegateAdaptor or UIApplicationDelegateAdaptor property wrappers to supply a type that should handle those delegate methods.
You can use it like this:
Code Block swift @main struct MyApp: App { @UIApplicationDelegateAdaptor private var appDelegate: AppDelegate var body: some Scene { WindowGroup { RootView() } } } class AppDelegate: NSObject, UIApplicationDelegate { }
With this declaration, a single instance of your App Delegate class will be created to handle any of the delegate methods that it implements, including push notification callbacks and/or CloudKit sharing invitations.