+ All Categories
Home > Technology > Hello watchOS2

Hello watchOS2

Date post: 17-Jan-2017
Category:
Upload: natasha-murashev
View: 245 times
Download: 0 times
Share this document with a friend
46
2 @NatashaTheRobot
Transcript
Page 1: Hello watchOS2

👋⌚2@NatashaTheRobot

Page 2: Hello watchOS2
Page 3: Hello watchOS2
Page 4: Hello watchOS2
Page 5: Hello watchOS2
Page 6: Hello watchOS2
Page 7: Hello watchOS2
Page 8: Hello watchOS2
Page 9: Hello watchOS2
Page 10: Hello watchOS2
Page 11: Hello watchOS2
Page 12: Hello watchOS2
Page 13: Hello watchOS2
Page 14: Hello watchOS2
Page 15: Hello watchOS2
Page 16: Hello watchOS2
Page 17: Hello watchOS2
Page 18: Hello watchOS2

👋⌚2

• Complications

• Watch Connectivity

Page 19: Hello watchOS2

Complicationsit’s complicated 🤔

Page 20: Hello watchOS2
Page 21: Hello watchOS2
Page 22: Hello watchOS2
Page 23: Hello watchOS2
Page 24: Hello watchOS2
Page 25: Hello watchOS2

Creating Complications with ClockKit

WWDC15 Session 209

Page 26: Hello watchOS2

https://github.com/tryswift/trySwiftApp

Page 27: Hello watchOS2
Page 28: Hello watchOS2

DO Repeat Yourself

Page 29: Hello watchOS2

// 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 }

Page 30: Hello watchOS2
Page 31: Hello watchOS2

DO Repeat Yourself

but not too much…

Page 32: Hello watchOS2

Watch Connectivity

Page 33: Hello watchOS2

Background Data Transfer

Page 34: Hello watchOS2

• application context

Page 35: Hello watchOS2

• application context

• user info transfer

Page 36: Hello watchOS2

• application context

• user info transfer

• file transfer

Page 37: Hello watchOS2

Interactive Messaging

Page 38: Hello watchOS2

• Immediate Information Transfer

• Requires reachable state

Page 39: Hello watchOS2

WCSession

Page 40: Hello watchOS2

// check needed for iOS App Only if WCSession.isSupported() { // activate session for both! let session = WCSession.defaultSession() session.delegate = self session.activateSession() }

Page 41: Hello watchOS2

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() }

Page 42: Hello watchOS2
Page 43: Hello watchOS2
Page 44: Hello watchOS2

Code Sample

Page 45: Hello watchOS2

👋⌚2

• Complications

• Watch Connectivity

Page 46: Hello watchOS2

Which future will you build for?


Recommended