包含 iOS 应用数据更改时更新 WatchKit 应用

Updating WatchKit app when containing iOS app's data changes

我一直在阅读 Apple Watch Programming Guide,我做了一些从 WatchKit 扩展请求数据到包含应用程序并取回结果的示例。但是如果我想反方向交流怎么办?我的意思是,假设我的 iOS 应用程序在前台,我在那里刷新了一些数据,然后我希望 WatchKit 应用程序根据其配对的 iOS 应用程序更新其用户界面刷新数据。我怎么能这样做?我应该从 iOS 应用程序向 WatchKit 应用程序启动本地通知,然后从中请求新数据,还是有其他(更好的)方式?

谢谢

要从 iOS 应用程序通知 Watch App 数据更改,您可以使用 Darwin 通知中心手动执行此操作。

更多参考在这里: https://devforums.apple.com/message/1082630#1082630

达尔文通知中心: https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/MacOSXNotifcationOv/DarwinNotificationConcepts/DarwinNotificationConcepts.html