如何获取Apple Watch硬件标识符?

时间:2015-04-24 20:13:07

标签: ios watchkit apple-watch

此页面http://theiphonewiki.com/wiki/Models似乎表明新款Apple手表的标识符为“Watch 1,1”和“Watch 1,2”

有人知道如何在连接手表的代码中获取此标识符吗? [WKInterfaceDevice currentDevice]似乎只给了我屏幕界限。

1 个答案:

答案 0 :(得分:2)

没有WatchKit方法来获取硬件标识符。为区分38毫米和42毫米手表,开发论坛中的Apple员工建议使用screenBounds上的WKInterfaceDevice属性。像这样:

if ([WKInterfaceDevice currentDevice].screenBounds.size.width == 136.0f) {
    // 38mm
}
else {
    // 42mm
}