build apps for apple watch - francesco novelli - codemotion milan 2016

54
BLINKAR TITLE WHO COMPANY FRANCESCO NOVELLI BUILD APPS FOR APPLE WATCH

Upload: codemotion

Post on 07-Jan-2017

62 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

BLINKAR

TITLE

WHO COMPANYFRANCESCO NOVELLI

BUILD APPS FOR APPLE WATCH

Page 2: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Who I am?

iOS Developer since 2009

Web Developer (LAMP)

Development Book Author

Freelance and Consultant

Apple Lovers

Page 3: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Thanks to BLINKAR

www.blinkar.com

Page 4: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Agenda

What is it an Apple Watch?

SDK history

App

Notifications

Complications

Final thoughts

Page 5: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

WHAT IS IT AN APPLE WATCH

Page 6: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

“It's the most personal product we've ever made”

–Tim Cook

Page 7: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

What is it an Apple Watch

Watch!

iPhone external device

Notification reader

Sport&Life tracker

Page 8: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

FAST DEVICE

When user raise the wrist is import to show what REALLY matter

Users DO NOT want loading on wrist

Users DO NOT want tap more than 2 times to get what they want

Page 9: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

SMALL DEVICE

Screen is tiny

Tapping is NOT the only solution

Input device are various

Microphone IS a solution for SOME problem, not every problem

Page 10: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

APPLE SDK: WATCHKIT

Page 11: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016
Page 12: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

watchOS 1

iOS-based OS

Native Apps with watchOS 2.0

iPhone connectivity framework

Need an iPhone companion app

Page 13: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

watchOS 2Complications

iPhone connectivity framework

Time Travel

Watch execute its own apps & Apps works also without an iPhone

Apps can interact with “all” sensor of Watch

Simple animation allowed

NEW

NEW

Page 14: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

watchOS 3Performance Performance Performance!

Dock Interface

NEW API

Background app refresh

Simplifying navigation

New Notification

NEW

Page 15: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

PerformanceFullscreen app MAYBE NOT the best way to use your app

Preload data

Simplifying UI

Use ALL CPU you need

Simulate async things (if you are confident with the task)

Page 16: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Dock

User can dock your application

Easiest way to interact with your app

Show only important information

Simplifying the interaction

Page 17: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

NEW API & FRAMEWORKS

SpriteKit

SceneKit

Inline Video

GameKit

CloudKit

Apple Pay

Digital Crown API

NEW Workout API

Speaker API

Page 18: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Background App Refresh

Use it for update snapshot of Docked App

Complications have 50 slot in a day

Normal apps has 24 updates in a day. (at least)

Choose the best time for the user

We can schedule or start refresh from push or iPhone

Page 19: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

APPLE WATCH APPS

Page 20: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

APPS

YOUR APP!

Page 21: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: 2 components

The Watch app contains the storyboards and resource files associated with all of your app’s user interfaces.

The WatchKit extension contains the code for managing those interfaces and for responding to user interactions

Different between watchOS 1 and 2: WatchKit extension on watchOS 1 was on IPhone

Page 22: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: 2 components

Code Files

StoryBoard, Images, Plists

Page 23: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: User Interface

Based on Storyboard

Different From iOS: it’s NOT a white board

Xcode arranges items for you, stacking them vertically on different lines.

You can customize scenes for different Apple Watch sizes, and you can configure different aspects of your interface.

Page 24: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: User Interface

Page 25: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: User Interface

Page 26: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: Navigation

Page-Based: storyboard

Hierarchical Interface: pushControllerWithName:

Modally: presentControllerWithName:

Page 27: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: Context Menu?Optional

Force Touch to activate context menu

MUST follow Apple Watch HIG

Configurable with storyboard or Code (addMenuItemWithImage:title:action:)

Easy way to avoid too much modal interface

Page 28: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: SettingsOnly on iPhone (Apple Watch App) with Settings Bundle

UserDefaults can be shared with iOS Companion app

Settings in iOS App

NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.watchApp"];

BOOL enabled = [defaults boolForKey:@"enabled_preference"];

Page 29: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: WatchConnectivity.framework

two-way communications between an iOS app and a Watch App

pass files and data back and forth

works in background also with inactive apps

Live communication if both apps are active

Page 30: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Simplifying Navigation

In watchOS 3 Apple has simplified their apps. It’s our turn

Digital Crown for simple interface

WKTable has new option

For 8 minutes last app used will be shown when user raise the wrist

Page 31: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apps: Recap

Native apps that works on the Apple Watch (watchOS 2.0)

Keep interface simple and follow Apple HIG

Do not use only modal

Interact with iPhone App

Page 32: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

NOTIFICATIONS

Page 33: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

NotificationThe most important part of Apple Watch

Everyone will see notification on Apple Watch

Page 34: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification

Every apps works by default

iPhone will decide where show the notification

Developers can personalize notification

Users can interact with notification

Users must allow apps to send notification on their iPhones

Page 35: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Looks

Short-Look Interface (last only 2 seconds)

Long-Look Inteface (last until users dismiss the notification)

Page 36: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Short-Look

Can NOT be personalized

Show only when the user raise its wrist

Automatically show the Long-Look if the users keep watching the Apple Watch

Page 37: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Long-LookDeveloper can design its own notification

It’s scrollable

Show notification content and actions

Actions are the same of the iPhone Notification

Actions can support text reply

Page 38: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Actions

Must be set on the iPhone app

Setting activation mode background will execute code on iPhone

Foreground activation will open Watch app

Page 39: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Customize Long Notification

Must exist a static version of notification

Developers can create a dynamic version of notification with custom design

watchOS will try to show the dynamic version, but if it’s too slow will show the static version

Page 40: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Static

Can be personalized only the top band color and text formatting

watchOS will set only the label notificationAlertLabel with message of notification

Must be created using a storyboard

Page 41: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: DynamicAll interface can be personalized

A subclass of WKUserNotificationInterfaceController configures the interface

Can include images and other UI controls

Use maps and table less possible

Do not include buttons, switches, or other interactive controls.

Page 42: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Dynamic HOW TO

- (void)didReceiveRemoteNotification:(NSDictionary *)remoteNotification withCompletion:(void(^)(WKUserNotificationInterfaceType interface)) completionHandler { // Get the aps dictionary from the payload. NSDictionary* apsDict = [remoteNotification objectForKey:apsKeyString]; // Set text of labels... NSString* titleString = [apsDict objectForKey:titleKeyString]; [self.titleLabel setText:titleString]; // Tell WatchKit to display the custom interface. completionHandler(WKUserNotificationInterfaceTypeCustom); }

Page 43: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification FROM the watch

NEW on watchOS 3

We can schedule right on the watch

Works also without an iPhone

App can decide in which device show the notification

App can demand decision to the OS

Page 44: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Notification: Recap

Notification are the most important things on Apple Watch

Can be personalized if exist an Apple Watch app

Provide a better experience with custom interface

Dynamic Interface must be fast to show or users won’t see your amazing interface

Page 45: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

COMPLICATIONS

Page 46: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

ComplicationsNEW in watchOS 2.0

It’s not an Apple name; exist from years in watch industries

Can be integrated in every apps

Various style based on clock interface

Uses ClockKit.framework

Page 47: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Apple Default Complications

Page 48: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Complications: Types

Page 49: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Complications: HOW TOWorks like a timeline

You need to preload information

Users can “time travel” with digital crown

Page 50: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Complications: Summary

Cannot load data when users raise its wrist or when start time traveling; must be preloaded

Preload cannot work for every complications

Refresh when whenever the app works

Keep data updates and show only useful things

Page 51: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Complications: More…

WWDC ’15 Session 209 Creating complications with ClockKit

ClockKit Framework Reference (developer.apple.com)

Page 52: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

FINAL THOUGHT

Page 53: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Build Apple Watch Apps

Apple Watch is big opportunity for developers

Apple Watch users love to have their apps on the wrist

Different types of “apps”: choose the best one

Apple Watch is: small&fast device. Keep it in mind during UX Design

Page 54: Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016

Thanks! Q&A Time

Francesco Novelli [email protected]

@if9

http://www.9lli.it/francesco

www.blinkar.com