2015-08-25 83 views

回答

5

所以在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 
     } 
    } 

我希望这将帮助你:)

+2

作为iOS的9.3你的必须等待'session(_:activationDidCompleteWith:error:)'在委托上被调用,然后才能从session.paired获得可靠的值' – Petter

相关问题