此页面http://theiphonewiki.com/wiki/Models似乎表明新款Apple手表的标识符为“Watch 1,1”和“Watch 1,2”
有人知道如何在连接手表的代码中获取此标识符吗?
[WKInterfaceDevice currentDevice]
似乎只给了我屏幕界限。
答案 0 :(得分:2)
没有WatchKit方法来获取硬件标识符。为区分38毫米和42毫米手表,开发论坛中的Apple员工建议使用screenBounds
上的WKInterfaceDevice
属性。像这样:
if ([WKInterfaceDevice currentDevice].screenBounds.size.width == 136.0f) {
// 38mm
}
else {
// 42mm
}