[英]Is it possible to add an AppDelegate to an independent watchOS SwiftUI app?
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我想一个AppDelegate中添加作为表示一个独立的watchOS SwiftUI应用程序(没有随iOS应用) 在这里,但我似乎无法解决问题的范围找不到类型“UIApplicationDelegate”
Explicitly adding an import UIKit does not help.显式添加导入 UIKit 无济于事。
Any clues?有什么线索吗?
https://developer.apple.com/documentation/uikit/uiapplicationdelegate https://developer.apple.com/documentation/uikit/uiapplicationdelegate
UIApplicationDelegate
seems to only work with Catalyst, iOS and TvOS. UIApplicationDelegate
似乎只适用于 Catalyst、iOS 和 TvOS。 Per WatchKit documentation it using the WKExtensionDelegate
that has all the same methods.每WatchKit文档它使用
WKExtensionDelegate
具有所有的相同方法。
https://developer.apple.com/documentation/watchkit/working_with_the_watchos_app_life_cycle https://developer.apple.com/documentation/watchkit/working_with_the_watchos_app_life_cycle
https://developer.apple.com/documentation/watchkit/wkextensiondelegate https://developer.apple.com/documentation/watchkit/wkextensiondelegate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.