【发布时间】:2015-04-29 22:17:55
【问题描述】:
我正在构建一个应用程序来计算你进了多少球。
我想知道发送收集到的数据的最佳方式是什么
Apple Watch 到 iPhone(并在 iPhone 上显示)
块引用
// Watchkit extension
var count = 1
// a label
@IBOutlet weak var goals: WKInterfaceLabel!
// a button in the Apple Watch
@IBAction func addCount() {
goals.setText("\(count++)")
}
// IPhone View Controller
@IBOutlet weak var yourTeamScore: UILabel!
我已经为扩展程序和 Apple Watch 设置了我的应用组。
我应该使用 NSUserDefaults 将数据存储在扩展程序上,然后将其发送到 iPhone 应用程序(视图控制器)吗?
是否可以使用 openParentApplication:reply 使用 Apple Watch 上收集的数据更新 iPhone 上的标签
【问题讨论】:
标签: watchkit