gpt4 book ai didi

watchkit - 有没有办法区分 38mm 和 42mm Apple Watch 版本?

转载 作者:行者123 更新时间:2023-12-05 09:22:02 24 4
gpt4 key购买 nike

我正在为 Apple Watch 编写应用程序,我必须针对 38 毫米和 42 毫米版本以不同方式显示某些内容。

使用 UIDevice.currentDevice().model 你可以获得 iphone 的型号(尽管它在 Xcode 中只显示 “iPhone Simulator”,但你明白了).

有没有办法获得具有类似功能的 Apple Watch 型号,38 毫米或 42 毫米?

最佳答案

我找到答案了!如果您有兴趣:

WKInterfaceDevice.currentDevice().screenBounds.size

将为 38mm 版 Apple Watch 提供 (136.0,170.0),为 42mm 版 Apple Watch 提供(156.0,195.0)。有了这些信息,您就可以区分这些设备。

关于watchkit - 有没有办法区分 38mm 和 42mm Apple Watch 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29147882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com