Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Time Matters: A WatchKit Story

Time Matters: A WatchKit Story

This is a talk I gave at @SwiftConf 2015. It shows what decisions we made at HRS during the development of our first WATCH extension and why.

Michael Ochs

June 24, 2015
Tweet

More Decks by Michael Ochs

Other Decks in Programming

Transcript

  1. SwiftConf.com
    Michael Ochs
    Time Matters: A WatchKit Story

    View Slide

  2. SwiftConf.com
    HRS - Hotel Reservation Service

    WATCH app in the store on launch day

    Developed by two engineers

    Completely written in Swift

    View Slide

  3. SwiftConf.com
    Considerations

    Concept

    Implementation

    View Slide

  4. SwiftConf.com
    Considerations

    View Slide

  5. SwiftConf.com
    A watch is about time

    It has a very small display

    It is used at a glance

    View Slide

  6. SwiftConf.com
    Notifications

    Complications - watchOS 2

    Glances

    Watch App

    View Slide

  7. SwiftConf.com
    A watch is about time

    Information needs to be relevant now

    Inform about the current or upcoming event

    Progress further in the timeline on user request

    Information at a glance

    View Slide

  8. SwiftConf.com
    It has a very small display

    Show the most important information

    As little user interaction as possible

    Handoff is your friend

    View Slide

  9. SwiftConf.com
    It is used at a glance

    A couple of seconds

    It is about consuming information

    View Slide

  10. SwiftConf.com
    Concept

    View Slide

  11. SwiftConf.com
    What is the most important feature of the iOS app?

    Booking a hotel
    What is the most time relevant feature?

    When is my next reservation?
    What is the most important information while on the go?

    Where is my next reservation?

    View Slide

  12. SwiftConf.com
    Show upcoming bookings

    Show location relevant information

    Show time relevant information

    View Slide

  13. SwiftConf.com
    Upcoming bookings Hotel detail
    hotel name hotel address
    city hotel on map
    number of nights hotel phone number
    arrival date earliest checkin time
    departure date reception opening time
    current booking? reception closing time

    View Slide

  14. SwiftConf.com
    Upcoming bookings Hotel detail
    hotel name hotel address
    city hotel on map
    number of nights hotel phone number
    arrival date
    earliest checkin time

    reception opening time

    reception closing time
    departure date
    current booking?

    View Slide

  15. SwiftConf.com

    View Slide

  16. SwiftConf.com
    Implementation

    View Slide

  17. SwiftConf.com
    Watch Extension
    Watch App iOS App
    Storyboards Code

    View Slide

  18. SwiftConf.com
    Watch Extension
    Watch App iOS App
    Storyboards Code
    watchOS 2

    View Slide

  19. SwiftConf.com
    Watch Extension

    Business logic

    Control flow

    iOS App

    Long running tasks

    Network operations

    View Slide

  20. SwiftConf.com
    UI & data communicates asynchronously

    Extension has no background execution

    Extension and iOS app have different sandboxes

    View Slide

  21. SwiftConf.com
    Watch Extension
    Watch App iOS App
    App Group App Group

    View Slide

  22. SwiftConf.com
    Watch Extension
    Watch App iOS App
    watchOS 2
    App Group App Group

    View Slide

  23. SwiftConf.com
    Communication between Extension and iOS app

    WatchConnectivity

    func updateApplicationContext(_: [String : AnyObject]) -> Void
    func sendMessage(_: [String : AnyObject],

    replyHandler: (([String : AnyObject]) -> Void)?,

    errorHandler: ((NSError) -> Void)?) -> Void
    optional func session(_ session: WCSession,

    didReceiveApplicationContext: [String : AnyObject]) -> Void
    optional func session(_: WCSession,

    didReceiveMessage: [String : AnyObject],

    replyHandler: ([String : AnyObject]) -> Void) -> Void
    watchOS 2

    View Slide

  24. SwiftConf.com
    Summary

    View Slide

  25. SwiftConf.com
    Time relevant information

    Information on the go

    Keep information very condensed

    As little user interaction as possible

    Ensure UI is understandable at a glance

    Keep communication at a minimum

    View Slide

  26. SwiftConf.com
    Michael Ochs

    @_mochs

    [email protected]

    ios-coding.com
    Thank you.

    View Slide