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 full-size 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 full-size slide

  3. SwiftConf.com
    Considerations

    Concept

    Implementation

    View full-size slide

  4. SwiftConf.com
    Considerations

    View full-size slide

  5. SwiftConf.com
    A watch is about time

    It has a very small display

    It is used at a glance

    View full-size slide

  6. SwiftConf.com
    Notifications

    Complications - watchOS 2

    Glances

    Watch App

    View full-size 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 full-size 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 full-size slide

  9. SwiftConf.com
    It is used at a glance

    A couple of seconds

    It is about consuming information

    View full-size slide

  10. SwiftConf.com
    Concept

    View full-size 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 full-size slide

  12. SwiftConf.com
    Show upcoming bookings

    Show location relevant information

    Show time relevant information

    View full-size 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 full-size 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 full-size slide

  15. SwiftConf.com

    View full-size slide

  16. SwiftConf.com
    Implementation

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  19. SwiftConf.com
    Watch Extension

    Business logic

    Control flow

    iOS App

    Long running tasks

    Network operations

    View full-size slide

  20. SwiftConf.com
    UI & data communicates asynchronously

    Extension has no background execution

    Extension and iOS app have different sandboxes

    View full-size slide

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

    View full-size slide

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

    View full-size 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 full-size slide

  24. SwiftConf.com
    Summary

    View full-size 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 full-size slide

  26. SwiftConf.com
    Michael Ochs

    @_mochs

    [email protected]

    ios-coding.com
    Thank you.

    View full-size slide