Is it possible to add an AppDelegate to an independent watchOS SwiftUI app?

1.1k Views Asked by At

I am trying to add an AppDelegate to a standalone watchOS SwiftUI app (no companion iOS app) as indicated in here, but I can't seem to resolve the issue Cannot find type 'UIApplicationDelegate' in scope

Explicitly adding an import UIKit does not help.

Any clues?

1

There are 1 best solutions below

0
On

https://developer.apple.com/documentation/uikit/uiapplicationdelegate

UIApplicationDelegate seems to only work with Catalyst, iOS and TvOS. Per WatchKit documentation it using the WKExtensionDelegate that has all the same methods.

https://developer.apple.com/documentation/watchkit/working_with_the_watchos_app_life_cycle

https://developer.apple.com/documentation/watchkit/wkextensiondelegate