Passing data to Apple Watch app from iPhone


I made a utility for transferring the data between iWatch and iPhone. This is done using the WatchConnectivity framework which is available in watch OS 2 and later.General steps to perform. Although all steps are written in the working sample code.
  • Create the WCSession
  • Implement the WCSessionDelegate methods. WKInterfaceController will receive the context dictionary in one of the delegate method.
  • In the UIViewController, Create the WCSession. When ever you want to share information to watch, then update the ApplicationContext 
                try WatchData.sharedInstance.session.updateApplicationContext(["message" : message])





Popular posts from this blog

Play youtube video in iOS app

Disabling print for Production In Swift Project

Vector graphics in iOS