👋⌚2
@NatashaTheRobot
👋⌚2
• Complications
• Watch Connectivity
Complications
it’s complicated 🤔
Creating Complications
with ClockKit
WWDC15 Session 209
https://github.com/
tryswift/trySwiftApp
DO
Repeat Yourself
// 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
}
DO
Repeat Yourself
but not too much…
Watch Connectivity
Background Data Transfer
• application context
• application context
• user info transfer
• application context
• user info transfer
• file transfer
Interactive Messaging
• Immediate Information
Transfer
• Requires reachable
state
WCSession
// check needed for iOS App Only
if WCSession.isSupported() {
// activate session for both!
let session = WCSession.defaultSession()
session.delegate = self
session.activateSession()
}
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()
}
Code Sample
👋⌚2
• Complications
• Watch Connectivity
Which future will you
build for?

Hello watchOS2