Build watchOS Apps: Develop and Design

Book description

Quickly get started creating WatchKit apps with this essential beginners guide to building apps for the Apple Watch. In this book, coauthors Mark Goody and Maurice Kelly introduce you to the technical aspects of building WatchKit apps and show you how to create a WatchKit project.

In each chapter, Mark and Maurice highlight key WatchKit concepts, offering guidance and highlighting best practices, on the way to building apps for the Apple Watch. Readers will not just learn the concepts of WatchKit but understand how to use them in a real-world setting. Mark and Maurice cover how to use extensions to extend functionality and content to the watch, how to handle navigation and controls, and how to design the user interface for your apps. The coauthors look at how to handle notifications and how to communicate with an iPhone before turning to how to ship your WatchKit app.

Readers will learn how to

* Configure their WatchKit project.
* Create interfaces and navigate between screens.
* Work with interface objects.
* Manage information with glances.
* Handle remote and local notifications.

Part of the Develop and Design series, books built for both sides of your brain.

Table of contents

  1. Title Page
  2. Copyright Page
  3. Dedication Page
  4. Acknowledgments
  5. About the Authors
  6. Contents
  7. Introduction
    1. The Watch of Our Dreams
    2. The Apple Watch of Our Realities
    3. About This Book
    4. How to Use This Book
      1. Organization
      2. Code Samples
      3. Text Formats
      4. Software Versions
  8. Welcome to watchOS
  9. Part I: Getting Started
    1. Chapter 1. Creating a WatchKit Project
      1. Lifelong Companions
      2. Adding Code to Your WatchKit App
        1. Updating the Watch Interface
        2. Writing Code for the Watch App
      3. “I’m Sorry, But I Don’t Have a Watch”
        1. What Do You Want to Test?
        2. Trying Out HelloWrist!
      4. Wrapping Up
    2. Chapter 2. Anatomy of a watchOS App
      1. Apps and Extensions
        1. What Is a WatchKit App?
        2. What Is a WatchKit Extension?
        3. Why Do We Need This Convoluted System?
      2. WatchKit App Project Layout
      3. Creating WatchKit Apps and Extensions
        1. Using Project Templates
        2. Using Target Templates
        3. Using Old-School Techniques
      4. Wrapping Up
    3. Chapter 3. Implementing Navigation
      1. Navigating the Apple Watch
      2. Navigation Types
        1. Page-based Navigation
        2. Hierarchical Navigation
      3. The WKInterfaceController
        1. The Circle of Life
        2. Supporting Navigation
      4. The Context Menu
      5. And So Much More
      6. Wrapping Up
    4. Chapter 4. Exploring Controls
      1. House Rules
      2. WatchKit Controls
        1. Simple Display Controls
        2. Interactive Controls
        3. Structural Controls
        4. User Input
      3. Wrapping Up
  10. Part II: Creating Apps
    1. Chapter 5. Designing Your App’s User Interface
      1. Thinking About Design
      2. Meeting the Challenge
        1. “Phenomenal Cosmic Power, Itty-Bitty Living Space”
        2. Tap Targets, Fat Fingers, and Small Screens
        3. Bringing a Little Color
        4. Be Prepared
        5. Gesture and Touch
      3. Wrapping Up
    2. Chapter 6. Building Your App’s User Interface
      1. Laying Out the User Interface
        1. Grouping Interface Objects Together
        2. Handling the Different Screen Sizes
      2. Images and Animation
        1. Content vs. Chrome
        2. Getting Images onto the Watch
        3. Displaying Images
        4. Controlling Animation
        5. Picker-Linked Animation
      3. The Settings Interface
      4. Accessibility
        1. Why Accessibility?
        2. Dynamic Type
        3. VoiceOver
      5. Wrapping Up
    3. Chapter 7. Working with Complications
      1. Introducing Complications
        1. Timelines and Time Travel
        2. Complicated Arrangements
      2. Adding Complications
        1. Including a Complication in a New App
        2. Adding a Complication to an Existing App
        3. Including Image Assets
      3. ClockKit
        1. Timeline Settings
        2. Complication Timeline Entries
        3. Providing Timeline Entries
      4. Testing Complications
        1. Creating the Test Scheme
        2. Running the Test Scheme
      5. Triggering Complication Updates
        1. Update Methods
        2. Budgeting
      6. Wrapping Up
    4. Chapter 8. Working with Glances
      1. What Is a Glance?
      2. Manufacturing a Glance
        1. Creating a Glance in a New Project
        2. Adding a Glance to an Existing Project
      3. Developing the Glance
        1. Visual Customization
        2. Working with WKInterfaceController
        3. Sneaking a Glance
      4. Wrapping Up
    5. Chapter 9. Working with Notifications
      1. What Are Notifications?
        1. iPhone Notifications
        2. Watch Notifications
      2. Creating a Notification Scene
        1. Creating a Notification in a New Project
        2. Adding a Notification to an Existing Project
      3. Designing Your Notifications
        1. Notification Layout
        2. Static Notifications
        3. Dynamic Notifications
      4. The WKUserNotificationInterfaceController
      5. Testing Notifications
        1. Notification Payloads
        2. Notification Test Schemes
      6. Actioning Notifications
        1. Tapping the Notification
        2. Text Responses
      7. Local Notifications
      8. Wrapping Up
  11. Part III: Making the Most of the Platform
    1. Chapter 10. Communicating with the Outside World
      1. Network Requests with NSURLSession
        1. The Watch and the Network
        2. Making the Request
        3. Handling Premature Deactivation
      2. Talking to the Phone with WatchConnectivity
        1. Background Transfer
        2. Live Message Transmission
        3. Making the Most of Inter-Device Communication
        4. Continuing User Activity with Handoff
      3. Wrapping Up
    2. Chapter 11. Accepting User Input
      1. Speech to Text
      2. The Text Input Controller
        1. Input Types
        2. Trying Out the Interface
        3. Preparing Suggestions
        4. Input from Notifications
      3. Wrapping Up
    3. Chapter 12. Playing and Recording Media
      1. Working with Media
        1. Media Types and Encodings
        2. Storing Media
      2. Foreground Playback
        1. Using WKInterfaceMovie
        2. Presenting a Player Programmatically
      3. Background Audio Playback
      4. Audio Recording
        1. Making a Recording
        2. Handling Recorded Audio
      5. Wraapping Up
    4. Chapter 13. Deploying to Physical Devices
      1. Managing Devices
      2. Configuring Provisioning Profiles
        1. Automagic Setup
        2. Manual Setup
      3. Deploying to a Device
      4. Wrapping Up
    5. Chapter 14. Using Hardware APIs
      1. Using Sensor Data
        1. Accessing Heart Rate Data via HealthKit
        2. Reading Accelerometer Data with CoreMotion
      2. Providing Haptic Feedback
        1. Playing with Haptics
        2. Tap Carefully
      3. Wrapping Up
    6. Chapter 15. Shipping Your WatchKit App
      1. Preparing Your App for Distribution
        1. Device Support
        2. Icons and Image Resources
        3. Back to the Developer Center
      2. iTunes Connect
        1. Creating an App Record
        2. Uploading Your App
      3. Distributing the App
        1. TestFlight Distribution
        2. App Store Distribution
      4. Wrapping Up
  12. Index
  13. Code Snippets

Product information

  • Title: Build watchOS Apps: Develop and Design
  • Author(s): Maurice Kelly, Mark Goody
  • Release date: December 2015
  • Publisher(s): Peachpit Press
  • ISBN: 9780134175218