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])



video


Comments

Popular posts from this blog

Vector graphics in iOS

Exception Handling - Objective C

How to show activity indicator in watch kit