有什么方法可以在 Apple Watch 中通知用户 iPhone 现在超出范围以及何时返回范围内。我们如何在 watch 扩展中做到这一点。
提前致谢。
最佳答案
所以在 WatchOS 2 上这是可能的!
你必须在 iPhone 端做:
首先:
import WatchConnectivity
然后:
if WCSession.isSupported() { // check if the device support to handle an Apple Watch
let session = WCSession.defaultSession()
session.delegate = self
session.activateSession() // activate the session
if session.paired { // Check if the iPhone is paired with the Apple Watch
// Do stuff
}
}
希望对你有帮助:)
关于ios - 如何检查 iPhone 和 Apple Watch 是否连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27793093/