我正在将我的 watchOS 1 应用程序升级到 watchOS 2,并注意到ExtensionDelegate
新的 watchOS 2 目标中有一个类。我尝试将此文件添加到我的 watchOS 1 应用程序(更新部署版本后),但它没有达到applicationDidFinishLaunching
.
这是我的班级的样子:
import WatchKit
class ExtensionDelegate: NSObject, WKExtensionDelegate {
func applicationDidFinishLaunching() {
// Perform any final initialization of your application.
print("applicationDidFinishLaunching for watchOS")
}
func applicationDidBecomeActive() {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillResignActive() {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, etc.
}
}
仅添加文件还有更多内容,还是我没有正确升级?