apple watchos 2 opportunity for native apps (vladimir zgonik technology stream)

35
Apple WatchOS 2 Opportunity for Native Apps Vladimir Zgonik

Upload: lviv-it-arena

Post on 21-Mar-2017

521 views

Category:

Technology


0 download

TRANSCRIPT

Apple WatchOS 2 Opportunity for Native AppsVladimir Zgonik

( 1) . , ios - Agilie. . Dribbble - .

: dribbble

( 2) Popular. Popular. , . , . Popular , (, , ). (invite) Debut. , , , Debut. , Dribbble . , - Popular. , Dribbble. .

: - , . , . .

(c 3) , . , . , . , . refresh . .

:

( 4) . - , , . , -. . , . . Add to Featured. , , . . , . Add to Featured Featured. , , . , , . Dribbble .

: Shot Bucket - .

( 5) iOS, Android Apple Watch. . dribbble, watchKit.: Apple Watch iOS.

( 6) dribbble.com, . Dribbble API (clientID, Client Secret, Client Access Token).

: Dribbble oauth 2.0 client.

( 7) NXOauth2Client, . : ( clientID/client secret) client NSURLConnection .. . NSNotificationCenter, . - GMTOAuth2, .

:Dribbble API

( 8) dribbble API . dribbble API. , 204 No content, REST like comment/like shot. 404 Not found. dribbble API 422 Unprocessable entity (1800), /.

: dribbble clientID.

( 9)Dribble 60 10 000 - .

: - , .

( 10) , : , like follow . 10 20 like follow. . . (low: check if like, check if follow; high: user info, switch category, like shot) , . , . , .

:

( 11) backend-. , , open source wrapper- Dribbble API.

: push-, push- .

( 12) , : last-modified . Background fetch ( 7 ios). , background fetch -> -> 304 -> -> 200 -> push-., background fetch.Apple , background fetch. , UIBackgroundFetchResultNewData background fetch ( - ). , background fetch .

:

( 13 ) open sorce SDK - warpper Dribbble API.

: ShotBucket Apple Watch.

( 14) Shot Bucket , , watchKit, , - . watchKit.

:

( 15) Apple Watch bluetooth watchKit , target Apple Watch ( . .) (), watchKit App . Target WatchKit Extension .

: , Apple Watch :)

( 16) , Apple

: Apple Watch

( 17) -> watcKit initial watchKit extension , -> UI . Initial : Apple Watch, ( Glance & Notification ), initial . : Shot Bucket Apple Watch( 18) watchKit 70 .

( 19) : . , . :). - ( , ).

: WatchKit Extension

( 20) apple , . , sharedApplication UIApplication, . : WatchKit Extension

( 21) :- API watchKit openParentApplication;- App Groups;- Darwin-notification

: API, watchKit

( 22) API , . . NSError . , reply() UI. - .

: App Group

( 23) App Groups ( ). NSUserDefaults, NSFileManager. : !

: , Darwin -

( 24) iOS , ; . pod MMWormHole.

: , Apple , .

( 25) Shot Bucket Apple Watch

:

( 26) , , , . . . .

: . , watchKit .

( 27) watchKit NSExtensionContext. : - init awakeWithContext willActivate, willActivate didDeactivate . , willActivate .

: Apple watchKit 1.0.1, .

( 28)

:

( 29) 10 , 10- - c ; awakeWithContext: , 10 , 10 . . bluetoth . 2 : - UI ; - apple watch ;

- : , , Appstore; . QR .

, , - - .

iPhone

Extension CommunicationGlanceNotificationWKInterfaceController

Apple Watch

WatchKit AppStoryboardResources

WatchKit ExtensionCodeResourcesWatchKit

WatchKit

watchKit app stores on watch deviceextension stores on iPhone and include code & resourcesinclude storyboard & static resources

1

Launch FlowLaunch WatchKit APPLoad initialinterface controllerInitialize UIDisplay UIStoryboard

Interface controllerinit

willActivate

WatchKit Extension

watchKit finds initial controller in storyboard & notifies iPhone

watchKit Extension should be launched & specified class of controller is

1

Standart interface typesNotification long lookGlanceNotification short look

1

Sharing code & Interprocess Communicationinclude model classes, web services, credentialsrestricted API

openParentApplication:reply:App GroupsDarwin-notification

1

openParentApplicationiPhone Host AppwatchKit Extension

write seed files to app groupsends user infogets input from wearerreads data from seed file

sends user info (include error)gets input from wearer

reply()updates in-memory datasystem wakes up in background+openParentApplication:reply:

launch

1

App GroupsContaining Apps Bundle

ExtensionBundle

App process

Extension process

SharedcontainerAppscontainerExtensionscontainer

com.apple.security.application-groups entitlementNSUserDefaults

NSFileManager

1

Darwin-notificationsInterprocesscommunication in iOS by means of Darwin-notifications.

Sending processNotification

notifydroutines allow processesto exchange stateless notification eventsprocess 1process 2process 3Client processes

1

willActivate

Page-based Controller Life Cycle Changes

Page 1

Page 2

Page 3StartedinitawakeWithContext:initawakeWithContext:initawakeWithContext:NSExtensionHostWillEnterForegroundNotificationNSExtensionHostDidBecomeActiveNotificationwillActivatewillActivatewillDeactivate

Page 1

Page 2

Page 3Swipe to Page 2willActivatedidDeactivate willActivate willDeactivateDrop armNSExtensionHostWillResignActiveNotificationNSExtensionHostDidEnterBackgroundNotificationdidDeactivateSuspendedDrop armNSExtensionHostWillEnterForegroundNotificationNSExtensionHostDidBecomeActiveNotification

1

Gallery on WatchOS 1

Photo Gallery

swipe

12:00

InitialInterfaceController

Modal controllerClose

Content. . .

Content. . .

swipeMore shots?

Load more. . .

reloadRootControllersWithNames:contexts:

1

watchOS

Subset of iOS frameworksInclude project frameworksNew watchOS Platform & SDKUI responsivenessNew UI elementsAnimationIndependent operationWi-Fi : NSURLSession

Features ArchitectureWatchExtension target in main app WatchExtension target in watch app Network access-able to connect to open Wi-Fi networksInterprocessCommunicationinstable, featureless methods(openParentApplication, Darwin)stabel & clear Connectivity FrameworkData Storagecaches folder (image caching)document folder (persistent)Animationgenerate a series of images and then iterate through themtrue IOS animations(animate properties)User Activityin root WKInterfaceControllerin WKExtensionDelegateWay to showinfo via appWatchApp, Glance, NotificationWatchApp, Glance, Notification, Complication

WatchOS 1 WatchOS 2

iPhone

Extension CommunicationGlanceNotificationWKInterfaceController

Apple Watch

WatchKit AppStoryboardResources

WatchKit ExtensionCodeResourcesWatchKit

WatchKit

1

iPhone

Extension CommunicationGlanceNotificationWKInterfaceController

Apple Watch

Watch App

iOS

WatchOS

WatchKit ExtensionCodeResourcesiOS App

Complication

StoryboardResources

2

Communicating with iOS app and networkCommunicate with network : NSURLSessionCommunicate with iOS app : WatchConnectivity

2

NOT SURE OF WHAT IS GOING ON HERE

Watch Connectivity Background transfer

Queue up contentOS transfer contentInformation not needed immediatelyApplication context (LIFO)User Info Transfer (FIFO)File Transfer (Once)

2

Watch Connectivity Interactive messaging

Replying: optional handler (confirmation by reciever)Live communicationDictionary (property list type)Data (custom data, own serialization)

2

Local data storagenon-purgeable, not restored

Document folder(persistent info)Purgeable Caches folder(go away at any time)Image cachingCaches folderCant store persistent infoWatchOS 2WatchOS 1

2

Animation

FrameOpacityBackground colorColor / tint colorGroup insets

2

New interface elementsPicker

MovieAudioPlayer

Alert

2

Complication layout and providers

10:09

ComplicationsTime

Complications

Image ProviderText ProviderRelative Date TextProvider

2

Complication families

10:09

Modular large

Modular small

Circular small

Utilitarian large

Utilitarian small

2

Complication Time Travel8

10:00 Keynote!10:00AM

12

8:2165

82:00 PlatformsState of Union! 2:30 PM8:2165

84:00 Apple Design Awards! 4:30 PM

6:30 PM

8:2165

10:0016:001:002:00

2

14:00

83:00 Platform State of the Union! 2:30 PM

8:2165

Complication Data SourcegetSupportedTimeTravelDirectionsForComplicationgetTimelineStart(End)DateForComplicationgetTimelineEntryForComplicationgetNextRequestedUpdateDateWithHandlergetPlaceholderTemplateForComplication

2

WKExtensionDelegateUser Activity:- watchOS : method on root WKInterfaceController- watchOS 2: method on WKExtensionDelegate

Callback methods for app lifecycle (UIApplicationDelegate):applicationDidFinishLaunching, applicationDidBecomeActive, applicationWillResignActive

2

WKExtension

Encapsulates the running application (analogous UIApplication)[[WKExtension sharedExtension] openSystemURL:url]valid schemes:- phone- SMS- PassKit

2

Using cocoapods

Specify the deployment target for watchOS in the Podspec:

Pod::Spec.new do |s|# s.watchos.deployment_target = '2.0'end

Any Pod that can support watchOS needs to explicitly add support by adding s.watchos.deployment_target.

2

http://agilie.com | http://mobile.design