WCSessionDelegate

suggest change

Introduction

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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents