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

WatchKit overview

WatchKit overview

A comprehensive overview of WatchKit for our monthly usergroup in Stuttgart http://mobilemaultaschen.de/

Florian

March 10, 2015
Tweet

More Decks by Florian

Other Decks in Programming

Transcript

  1. View Slide

  2. WatchKit

    View Slide

  3. iOS App

    View Slide

  4. View Slide

  5. App Groups

    View Slide

  6. NSUserDefaults

    View Slide

  7. NSUserDefaults
    let defaults =
    NSUserDefaults(suiteName:
    "group.com.keslcod.watch")

    View Slide

  8. NSFileManager

    View Slide

  9. NSFileManager
    let url = manager.
    containerURLForSecurityApplicatio
    nGroupIdentifier(“group.com.keslc
    od.watch")

    View Slide

  10. WatchKit
    Apps

    View Slide

  11. WatchKit Apps. Your app on Apple
    Watch contains a full user interface.
    Users can launch, control, and interact
    with your app in ways unique to Apple
    Watch.

    View Slide

  12. Glances. You can provide users with
    timely read-only information that they
    care about with a Glance — a quick and
    lightweight view of your app.

    View Slide

  13. Actionable Notifications. Actionable
    notifications built and designed with
    WatchKit let users take action right from
    their wrists.

    View Slide

  14. Styles

    View Slide

  15. Hierarchical
    similar to UINavigation-
    ViewController

    View Slide

  16. View Slide

  17. Page-based
    Total number of pages
    is fixed and must be set
    on compile time

    View Slide

  18. View Slide

  19. User
    Interface

    View Slide

  20. User Interface
    • Button
    • Label
    • Date/Time/Timer label
    • Separator
    • Switch
    • MapView
    • Image
    • Menu

    View Slide

  21. User Interface
    • defined at compile time
    • NSObject subclasses, *no* views
    • one way communication —> you can’t read
    properties of views on Apple Watch

    View Slide

  22. WKInterfaceControllerer
    • init
    • awakeWithContext()
    • willActivate()
    • didDeactivate()

    View Slide

  23. WKInterfaceGroup
    • horizontal/vertical flow layout
    • margins/spacing
    • can be nested
    • background color/image

    View Slide

  24. WKInterfaceTable
    • single column
    • multiple row types (header, content, footer)
    • every row backed by controller, subclass of
    NSObject

    View Slide

  25. WKInterfaceMap
    • non-interactive snapshop
    • up to 5 annotations
    • tap opens the Maps app on iPhone

    View Slide

  26. Animations
    • no dynamic animations
    • Flipbook —> https://github.com/frosty/Flipbook

    View Slide

  27. Dev.
    Setup

    View Slide

  28. Dev. Setup
    • Xcode
    • 8.2 GM
    • 8.3 β2 (—> Swift 1.2)
    • iOS simulator
    • Hardware - External Displays - Apple Watch

    View Slide

  29. View Slide

  30. Bezel
    http://infinitapps.com/
    bezel/

    View Slide

  31. View Slide

  32. Xscope
    http://xscopeapp.com

    View Slide