See the time on your wrist - Apple Watch presentation

22
Software Development Done Right See the time on your wrist 1 June 4th, 2015 Lammert Westerhoff Jeroen Leenarts

Transcript of See the time on your wrist - Apple Watch presentation

Software Development Done Right

See the time on your wrist

1

June 4th, 2015

Lammert Westerhoff Jeroen Leenarts

Who are we?Lammert Westerhoff - iOS Developer at Xebia - Currently at NS

Jeroen Leenarts - iOS Developer at Xebia - Founder Stichting CocoaHeadsNL - Currently at ING CB

2

• Introduction • Design • Data Transfer

3

Three components

4

Notifications Glances

10:09MOVE

Activity

EXERCISESTAND

Watch Apps

AM PM

Cancel Set

12 1

2

3

4

567

8

9

10

11

0 00:

https://developer.apple.com/watch/human-interface-guidelines/app-components/

5Not possible to mix

hierarchicalpage-basedWatchKitNo native watch apps Limited UI possibilities - No drawing, static only - Only standard elements like labels,

images - Either page-based navigation or

hierarchical

https://developer.apple.com/watch/human-interface-guidelines/app-components/

Designing a Watch App for the XebiCon Schedule app

6

XebiCon app for iPhone

7

Design for Apple Watch

8

Don’t do a design like this

Why did we ditch it?The Watch is slow - opening a view is slow. So a deep navigation doesn’t work.

9

Who would read this on such a small screen?

There are many things that just don’t work on a very small screen The user always has his phone with him

Another approach

10

Design for WatchKeep things simple and fast Don’t port your entire app to the watch - Structure can be different Focus on one important aspect of your app - What does the user want to do in a very short amount of time?

11

Architecture

12https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/

User Actions

13https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/

App

WatchKit Extension

Initial Data

14

App

WatchKit Extension

Data

We can’t execute code in the Watch. We can do an HTTP Request from the Extension, but… - Apple says no - Will stop complete when

Watch app is closed Right place is our app - And in our case the app likely

already has the data so no need for request

App

WatchKit Extension

Sharing dataEnter technical note TN2408 - File coordinators and shared containers is a no-no Instead use - CFPreferences - `writeToFile:atomically:` (Atomic write) - SQLite - Core Data

15

Oh and let's not forgetIn no way is your data guaranteed to be stored with SQLite and Core Data.

16

Think about writing data thoughSQLite and Core Data double entries

- Atomic writes, last writer wins

Storing in the cloud works very well - Be it CloudKit or a random web address

17

What aboutopenParentApplication:reply: application:handleWatchKitExtensionRequest:reply:

It is - Pretty slow - Gets even slower with more data - But potentially very useful, it wakes up the containing app

18

MMWormhole

As simple as[self.wormhole passMessageObject: @{@"buttonNumber" : @(1)} identifier:@"button"]; [self.wormhole listenForMessageWithIdentifier:@"button" listener:^(id messageObject) { self.numberLabel.text = [messageObject[@“buttonNumber"] stringValue]; } ];

Internally uses Darwin Notifications and atomic writes

19

[self.wormhole passMessageObject: @{@"buttonNumber" : @(1)} identifier:@"button"];[self.wormhole listenForMessageWithIdentifier:@"button" listener:^(id messageObject) { self.numberLabel.text = [messageObject[@"buttonNumber"] stringValue]; } ];

Too much complexity?In the end, we made due with a shared NSUserDefaults

- Have the iPhone figure out when and how to fetch data - Silent push notifications - Preparing and staging data

Apple Watch screen is tiny - So how much data do you really need? - Focus on “the interaction”

20

ConclusionThe Apple Watch is still early stages - Native coming soon - Hopefully more stability and better API’s coming

along with it

Complement your iPhone app with a Watch App really designed for the watch - Simplicity & Speed - Pay attention to integration with the iPhone

21

Questions?

22

Find us on Twitter

@lwesterhoff

@leenarts