gpt4 book ai didi

ios - WatchKit - iPhone 不可用屏幕

转载 作者:可可西里 更新时间:2023-11-01 02:17:29 26 4
gpt4 key购买 nike

自从我将我的项目迁移到 watchOS2 - “iPhone 不可用”屏幕突然消失了。

OS1 中,这是一种“默认”行为,现在 watch 拥有自己的数据集,这会在我尝试将 watch 和手机同步在一起时产生问题。

我的问题是 - 我如何检查手机是否已配对,如果未配对则停止执行任何操作(如在 OS1 中)并恢复该屏幕?

屏幕示例:http://belencruz.com/wp-content/uploads/2015/06/IMG_20150624_175906-e1435296319135-1024x979.jpg

最佳答案

您必须在 WCSession 实例上使用 paired

import WatchConnectivity

if WCSession.defaultSession().paired {

}

配对

A Boolean indicating whether the current iPhone is paired to an Apple Watch. (read-only)

此外,您还必须检查 watchAppInstalled

A Boolean value indicating whether the Watch app is installed on the currently paired and active Apple Watch. (read-only)

关于ios - WatchKit - iPhone 不可用屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35680657/

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