cotap tech talks: roderic campbell, minority report ux with an apple watch
TRANSCRIPT
Minority Report with an Apple Watch
@roderic 1
or how close can we get?
@roderic 2
Agenda• The Movie
• The Demo
• The Watch
• The Motion
• The Network
• The Next Steps
@roderic 3
The Movie
• Precognition
@roderic 4
The Movie
• Precognition
• Robots building robot cars around 2 cops fighting
@roderic 5
The Movie
• Precognition
• Cool autonomous cars
• Non-lethal weapons
@roderic 6
The Movie
• Precognition
• Cool autonomous cars
• Non-lethal weapons
• The multitouch, multidiminsional UI
@roderic 7
Agenda• The Movie ✔
• The Demo
• The Watch
• The Motion
• The Network
• The Next Steps
@roderic 8
@roderic 9
The Watch ⌚• WatchOS was a good start
@roderic 10
The Watch ⌚• WatchOS was a good start
• WatchOS 2 opens up a few new things
@roderic 11
The Watch ⌚• WatchOS was a good start
• WatchOS 2 opens up a few new things
• WatchOS 2 developing for the watch should be very familiar
@roderic 12
@roderic 13
The Watch ⌚• Access to the Accelerometer
• WatchConnectivity
@roderic 14
Agenda• The Movie ✔
• The Demo ✔
• The Watch ✔
• The Motion
• The Network
• The Next Steps
@roderic 15
The Motion (CoreMotion)
@roderic 16
The Motion (CoreMotion)import CoreMotionlet manager = CMMotionManager()manager.accelerometerUpdateInterval = 0.5...if (manager.accelerometerAvailable) {
manager.startAccelerometerUpdatesToQueue(motionQueue) { (data:CMAccelerometerData?, error:NSError?) -> Void in if let accel = data { // process the data on the watch }}
@roderic 17
Agenda• The Movie ✔
• The Demo ✔
• The Watch ✔
• The Motion ✔
• The Network
• The Next Steps
@roderic 18
The Network (WatchConnectivity)import WatchConnectivity
if(WCSession.isSupported()) { WCSession.defaultSession().delegate = self WCSession.defaultSession().activateSession()}
@roderic 19
The Network (WatchConnectivity)public class WCSession : NSObject {... public var paired: Bool { get } public var reachable: Bool { get }
public func sendMessage(message: [String : AnyObject], replyHandler: (([String : AnyObject]) -> Void)?, errorHandler: ((NSError) -> Void)?)
public func updateApplicationContext(applicationContext: [String : AnyObject]) throws}
@roderic 20
The Network (WatchConnectivity)public protocol WCSessionDelegate : NSObjectProtocol { // queueing mechanism optional public func session(session: WCSession, didReceiveMessage message: [String : AnyObject])
// just an update, drop everything else optional public func session(session: WCSession, didReceiveApplicationContext applicationContext: [String : AnyObject])}
@roderic 21
The Network (WatchConnectivity)let message = ["x" : a.x, "y" : a.y, "z" : a.z, "time" : NSDate().timeIntervalSince1970, "rate": self.manager.accelerometerUpdateInterval]
session.sendMessage(message, replyHandler: { (content:[String : AnyObject]) -> Void in // Our counterpart can send an optional response}, errorHandler: { (error ) -> Void in // do something with the error})
@roderic 22
The Network (WatchConnectivity)func session(session: WCSession, didReceiveMessage message: [String : AnyObject], replyHandler: ([String : AnyObject]) -> Void) {
if let xValue = message["x"] { self.xLabel.text = "x: ".stringByAppendingString(String(xValue)) // you know, or something more interesting than setting a label } ...}
@roderic 23
Agenda• The Movie ✔
• The Demo ✔
• The Watch ✔
• The Motion ✔
• The Network ✔
• The Next Steps
@roderic 24
The Next Steps• ! Testing shows .2s lag time to send and update the UI
• ⌚ Access to the gyroscope on the watch would be lovely
• ⌚ Handling the watch reachability when the screen turns off
• # DeckRocket (https://github.com/jpsim/DeckRocket)
@roderic 25
The Next Steps• ⌚ " Entirely new gesture language with the watch and the
phone together
• ⌚ Putting together an actual UI with element selection, switching contexts, lists
• " 3D Touch with the new iPhone 6(+)s
@roderic 26
• Code: https://github.com/rodericj/MinorityReportWithWatch
• Blog: http://thumbworks.io
• Contact:
• @roderic
• http://github.com/rodericj
"Sometimes, in order to see the light, you have to risk the dark." - Dr. Iris Hineman
"Goodbye Crow" - John Anderton
@roderic 27