执行时
template.headerTextProvider = CLKSimpleTextProvider(text: header)
Run Code Online (Sandbox Code Playgroud)
在ComplicationController,我收到了大量类似的错误消息,到目前为止我还没有找到解决方法:
objc[4499]: Class SPProtoAudioFilePlayerStatus is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/WatchKit.framework/WatchKit and /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/PrivateFrameworks/SockPuppetGizmo.framework/SockPuppetGizmo. One of the two will be used. Which one is undefined.
objc[4499]: Class SPProtoSerializer is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/WatchKit.framework/WatchKit and /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/PrivateFrameworks/SockPuppetGizmo.framework/SockPuppetGizmo. One of the two will be used. Which one is undefined.
objc[4499]: Class SPProtoAudioFilePlayerMessage is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/WatchKit.framework/WatchKit and /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/PrivateFrameworks/SockPuppetGizmo.framework/SockPuppetGizmo. One of the two will be used. Which one is undefined.
objc[4499]: Class SPProtoCacheSyncData is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/WatchKit.framework/WatchKit and …Run Code Online (Sandbox Code Playgroud) apple-watch watchkit clockkit watchos-2 apple-watch-complication
我正在为 Apple Watch 开发一个计时器应用程序。
在特定时间(计时器结束),iPhone 会触发计划UILocalNotification,在不活动的 Apple Watch 上应触发触觉警报,告诉用户计时器已结束。
我这样做是因为一旦手表处于非活动状态,计时器就不会继续在 Apple Watch 上运行。
我面临的问题是:
a) 通知有时会显示在 iPhone 上而不是 Apple Watch 上(基于其他帖子,我担心这无法更改...)
b) 手表上没有触觉警报(纯粹显示通知,这仅在用户下次激活手表时,而不是在实际触发通知时)
func sendAwakeNotification(nextTime:NSDate) {
print("AppDelegate: - sendAwakeNotification")
dispatch_async(dispatch_get_main_queue()) { () -> Void in
let localNotification = UILocalNotification()
localNotification.fireDate = nextTime
localNotification.timeZone = NSTimeZone.defaultTimeZone()
localNotification.alertBody = "Finished Step"
localNotification.alertTitle = "Alert"
localNotification.soundName = UILocalNotificationDefaultSoundName
localNotification.category = "myTimer"
let userInfo: [NSObject : AnyObject] = [
"notification_id" : "myTimerNotification"
]
localNotification.userInfo = userInfo
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
}
}
Run Code Online (Sandbox Code Playgroud)
通知中的代码
override func …Run Code Online (Sandbox Code Playgroud) 我正在编写一个使用EKReminder的任务管理应用程序.在一台iOS设备上使用时效果很好.
当我在两个设备(相同的苹果帐户)上使用时,我意识到提醒更改同步具有显着的延迟,甚至经常是不完整的.(试过iCloud,google,公司展望)
因此,这似乎与我的应用程序无关(如果我直接在Reminder iOS应用程序中更改提醒,也会发生相同情况).
我可以通过编程方式强制同步提醒与他们链接到的任何服务(例如iCloud)并从我的应用程序中触发吗?
transferCurrentComplicationUserInfo和之间有什么区别transferUserInfo?
我想将数据从我的AppDelegate发送到时钟套件复杂功能.
transferCurrentComplicationUserInfo似乎完全一样transferCurrentUserInfo.我错过了什么吗?
apple-watch watchkit clockkit apple-watch-complication wcsession