2015-08-25 82 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

相關問題