jacky wang - kkbox apple watch app

31
KKBOX Apple Watch App Jacky Wang

Upload: jacky-wang

Post on 19-Mar-2017

402 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Jacky Wang - KKBOX Apple Watch App

KKBOX Apple Watch App

Jacky Wang

Page 2: Jacky Wang - KKBOX Apple Watch App

Agenda• Introduction of

KKBOX Watch App

• Interesting things

• Apple Watch Lab Challenges & Solutions

• What did we learn?

Page 3: Jacky Wang - KKBOX Apple Watch App

Introduction

Page 4: Jacky Wang - KKBOX Apple Watch App

App Store• Launched on April 21

Page 5: Jacky Wang - KKBOX Apple Watch App

Functionalities

• Play Control

• Lyrics

• Playlists

• Radio

Page 6: Jacky Wang - KKBOX Apple Watch App

DEMO

Page 7: Jacky Wang - KKBOX Apple Watch App

Interesting things during development

Page 8: Jacky Wang - KKBOX Apple Watch App

Context Menu

Page 9: Jacky Wang - KKBOX Apple Watch App

Context Menu• Original Design

• Use force touch to show menu

Force Touch

Rejected by Apple

Page 10: Jacky Wang - KKBOX Apple Watch App

Context Menu • Menu options have to be directly related to content on

screen

• Cannot be used as segue to other InterfaceControllers

Force Touch

Page 11: Jacky Wang - KKBOX Apple Watch App

Animation

Page 12: Jacky Wang - KKBOX Apple Watch App

Animation• Only support GIF

• Play Pause

• Next Previous song

Page 13: Jacky Wang - KKBOX Apple Watch App

Communication

WatchPhone ?

Page 14: Jacky Wang - KKBOX Apple Watch App

Communication - Shared Data

• NSUserDefault

• App groups must be enabled

• Commands, Data are stored in Shared Data

• Shared Data changed Notification is sent

WatchPhone

SD

notification

data

Page 15: Jacky Wang - KKBOX Apple Watch App

Communication -OpenParentApplication

• Main method of Data exchange

• No more sharedData

• One direction

• Watch needs to check and sync everything.

• Too expensive

WatchPhone

openParent

data

notification

Page 16: Jacky Wang - KKBOX Apple Watch App

Communication - WatchAppNotificationCenter

• CFNotification Center & Darwin Notification Center

• Allows adding specific observers and keys

• Only updates what is necessary

• Better performance

WatchPhone

openParent

data

Notification Center

Page 17: Jacky Wang - KKBOX Apple Watch App

Apple Watch LabTime Square, Hong Kong

Page 18: Jacky Wang - KKBOX Apple Watch App

Apple Watch Lab• Invited to test our app on real device for 2 days

Page 19: Jacky Wang - KKBOX Apple Watch App

Challenges

Page 20: Jacky Wang - KKBOX Apple Watch App

Challenges

• Everything was perfect on the simulator.

• Everything is different on the real device.

Page 21: Jacky Wang - KKBOX Apple Watch App

Debugging• Need to manually attach process to

iPhone and Apple Watch on simulator

• Xcode crashes when attaching process on real device

• Could only debug with NSLog

Page 22: Jacky Wang - KKBOX Apple Watch App

Launching in background

• Crash every time we launched app from watch

• Because app is only launched in background

• Be careful with what you do in the background

• Doesn’t show on simulator.

Page 23: Jacky Wang - KKBOX Apple Watch App

Cache Images• WatchKit Extension is slower than

simulator and unstable sometimes

• Cache any static images you can as early as possible

• A simple menu could cause unexpected lag

Page 24: Jacky Wang - KKBOX Apple Watch App

Creating Tables

• 2 out of 10 times, tables won’t load

• Task finished in code but screen only shows a loading indicator

• System bug?

• Left lab without a solution :(

Page 25: Jacky Wang - KKBOX Apple Watch App

Creating Tables • Last resort was keeping only Now Playing

• UX > Functionality

• Apple suggested maybe try using SharedData

• Rebuilt the communication infrastructure.

• Solved the problem.

Page 26: Jacky Wang - KKBOX Apple Watch App

Solution

• Instant status updates

• OpenParentApplication

• Data transfer

• SharedData

WatchPhone

SD

data

openParent

data

Notification Center

Page 27: Jacky Wang - KKBOX Apple Watch App

Creating Tables - Instagram

https://github.com/Instagram/IGInterfaceDataTable

Page 28: Jacky Wang - KKBOX Apple Watch App

What did we learn?

Page 29: Jacky Wang - KKBOX Apple Watch App

Never trust the simulator 100%

Always test on real device before shipping…

Page 30: Jacky Wang - KKBOX Apple Watch App

Never trust Apple 100%

Sometimes, they don’t even know what is best…