12. WatchConnectivity
The Watch Connectivity framework
(WatchConnectivity.framework) provides a two-way
communications conduit between an iOS app and a
WatchKit app on a paired Apple Watch.
13. WatchConnectivity
The Watch Connectivity framework
(WatchConnectivity.framework) provides a two-way
communications conduit between an iOS app and a
WatchKit app on a paired Apple Watch.
14. Setup
if (WCSession.isSupported()) {
let session = WCSession.defaultSession()
session.delegate = self // conforms to WCSessionDelegate
session.activateSession()
}
21. 3 + 1 Transfer Types
❖ Background transfers
• Application context
• User info transfer
• File transfer
❖ Interactive messaging
• Live communication
Background transfers
22. Background transfers
❖ Content not needed immediately
❖ OS intelligently transfers content
❖ Queue up content
❖ OS transfers content
❖ Sending side can exit
• Pick opportune time
• Delivers on receiver next launch
23. Background transfers
❖ Content not needed immediately
❖ OS intelligently transfers content
❖ Queue up content
❖ OS transfers content
❖ Sending side can exit
• Pick opportune time
• Delivers on receiver next launch
Recommended
24. 3 + 1 Transfer Types
❖
• Application context
• User info transfer
• File transfer
❖ Interactive messaging
• Live communication
Background transfers
25. Application context
❖ Most interesting/relevant content
❖ Overriding behavior
❖ Dictionary
❖ Property list types
❖ Recommended use cases
• Many Apple Watch apps
• Glances
33. User info transfer
❖ Queue user infos (dictionaries)
❖ Property list types(String, Number, Array, Dictionary…)
❖ In memory content
❖ Access to outstanding content in queue
43. File transfer
❖ Very similar to user info transfer
❖ Queue files
❖ Access to outstanding content in queue
❖ Additional metadata
❖ Small
• Property list types
71. Summary
❖ Extension has been moved to on Watch.
❖ All the most hardware API on the Watch can be used.
❖ Connect with iOS App by WatchConnectivity.
❖ Complications can be provided by Watch App.
❖ Almost all CocoaTouch frameworks are supported.
❖ Now you can play Taptic Engine.
❖ Digital Crown can be used on Simulator.