Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Hello watchOS2

791 views

Published on

This is an overview of watchOS 2 designed to give you the head start you need to start building! Learn about how to design for the Apple Watch, the different UI components included, how your Apple Watch works together (and independently) with your iOS app, and more!

Published in: Technology
  • Be the first to comment

Hello watchOS2

  1. 1. 👋⌚2 @NatashaTheRobot
  2. 2. 👋⌚2 • Complications • Watch Connectivity
  3. 3. Complications it’s complicated 🤔
  4. 4. Creating Complications with ClockKit WWDC15 Session 209
  5. 5. https://github.com/ tryswift/trySwiftApp
  6. 6. DO Repeat Yourself
  7. 7. // iOS app struct Session { let startTime: NSDate let endTime: NSDate let description: String let location: String let speaker: Speaker? } // Watch App struct Session { let startTime: NSDate let endTime: NSDate let location: String let speaker: Speaker? let index: Int }
  8. 8. DO Repeat Yourself but not too much…
  9. 9. Watch Connectivity
  10. 10. Background Data Transfer
  11. 11. • application context
  12. 12. • application context • user info transfer
  13. 13. • application context • user info transfer • file transfer
  14. 14. Interactive Messaging
  15. 15. • Immediate Information Transfer • Requires reachable state
  16. 16. WCSession
  17. 17. // check needed for iOS App Only if WCSession.isSupported() { // activate session for both! let session = WCSession.defaultSession() session.delegate = self session.activateSession() }
  18. 18. import WatchConnectivity class WatchSessionManager: NSObject, WCSessionDelegate { static let sharedManager = WatchSessionManager() private override init() { super.init() } private let session: WCSession? = WCSession.isSupported() ? WCSession.defaultSession() : nil // no need for the check on the Watch App: // private let session = WCSession.defaultSession() func startSession() { session?.delegate = self session?.activateSession() }
  19. 19. Code Sample
  20. 20. 👋⌚2 • Complications • Watch Connectivity
  21. 21. Which future will you build for?

×