WCSessionDelegate
suggest changeIntroduction
WCSessionDelegate works with watchOS 2 and later, using WatchConnectivity. This snippet assumes self adopts WCSessionDelegate. WCSession.default() is the Swift 3 name.
var watchSession : WCSession?
func startWatchSession(){
if(WCSession.isSupported()){
watchSession = WCSession.default()
watchSession!.delegate = self
watchSession!.activate()
}
}
session(_:didReceiveApplicationContext:) is optional. On iOS 9.3 and watchOS 2.2 and later, session(_:activationDidCompleteWith:error:) is required.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents