WCSession.isPaired in not available


(Chquanquan) #1

WCSession.isPaired in not available. i can not find this property, bu I see it in document.

(Quinn “The Eskimo!”) #2

It’s working for me. Specifically, I used Xcode 10 to create a new iOS project from the Single View Application template and then added this code to the viewDidLoad method:

let p = WCSession.default.isPaired

I also added the following to the top of the file:

import WatchConnectivity

With those the code compiled just fine.

Are you sure you’ve got this code in your iOS target? The property is marked as __WATCHOS_UNAVAILABLE, and thus is only available to your iOS app, not to your watchOS extension.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

(Chquanquan) #3

you are right, I'm use that property in watchOS extension...and thank you for your advice.