small medium large xlarge

Developing for Apple Watch: Your App on Their Wrists

by

Cover image for Developing for Apple Watch

Developing for Apple Watch

Your App on Their Wrists

by

The Apple Watch offers the closest connection yet between your app and users. But you can’t just port your existing iPhone app to the watch; instead, you’ll write a WatchKit Extension. Learn which of your app’s features should come to the watch, how make your UI look great on both watch sizes with WatchKit’s Interface Controller, and how to submit your app to the App Store and get it onto the wrists of your customers.

About this Title

Pages: 118
Published: 2015-05-27
Release: P2.0 (2015-07-16)
ISBN: 978-1-68050-068-4

With the Apple Watch, your app is right there on your user’s wrist. This book teaches you how to extend your existing iPhone app with a WatchKit Extension, giving your users quick access to your app’s most important features and an intimate user experience that’s always within arm’s reach.

You’ll learn how to display beautiful interfaces to the user, how to use the iPhone app for heavy number-crunching, and the best way to keep everything in sync across your users’ devices. You’ll develop a watch app to take advantage of the best WatchKit has to offer, and by the end of this book, you’ll be ready to ship your own apps to the App Store.

Plus, this book will help focus your efforts. What features make sense on the watch? How should you organize them? How do you tell your users what they can do? You’ll learn how to brainstorm to come up with the best strategy for your app.

When your users are proudly showing off their Apple Watch, this book will help you make sure it’s your app on there.

Tips and Tricks from Developing for Apple Watch: Your App on Their Wrists by Jeff Kelley

Do as little work as possible in your WatchKit Extension. You want your WatchKit app to be fast, and one of the best ways to do that is to divide your app’s work. Let your WatchKit Extension—the part of your iPhone app that controls the UI on the watch—handle the watch UI, and offload any long-running network requests, processor-intensive computations, or database management-style tasks to your iPhone app. You’ll be able to run your iPhone app code in the background, freeing up your WatchKit Extension for handling user input and updating your interface.

A touch of color goes a long way. The OLED screen of the Apple Watch gives you better battery life with a black background, but that doesn’t mean that your app has to be all gloom and doom. Black or dark gray backgrounds with a touch of color on the side or in text draw your users’ attention to key elements of the interface without breaking the battery bank.

Make friends with storyboards. Every piece of user interface in your watch app must first be created in your storyboard; there’s no programmatically creating user interfaces in code. Even if you’ve grown to dislike using storyboards or xibs in iOS development, you’ll be dependent on them for WatchKit user interfaces.

Put your most timely information in your Glance. Your WatchKit app can have only one Glance—an interface to display to your users quickly from their watch face—so make it count. It’s a place for your users to find your app’s most timely and relevant content, so be sure to give them exactly what they need.

Take advantage of system-provided internationalization. Apple provides built-in classes to format numbers, dates, units of length, energy, and mass, and more. By using them, your app will automatically use a format that’s appropriate for your users and where they live, letting you spend more time making great apps and less time formatting data.

Test on real watch hardware. The iOS Simulator, fantastic as it is, is not an entirely faithful reproduction of many hardware characteristics. Before sending your app to the App Store, if at all possible, run your app on a real Apple Watch. You’ll get a better sense of performance, look and feel, and integration with the rest of the watch’s features—including some things that you can’t reproduce on the simulator.

Read the reviews .

What You Need

You’ll need a Mac running Xcode 6.2 or higher, and for deploying your app to a real watch, you’ll need an Apple Watch and compatible iPhone. You’ll also need a membership in Apple’s developer program to do any on-device testing.

Contents & Extracts

  • Acknowledgments
  • Preface
    • What’s in This Book?
    • Who’s This Book For?
    • The Code in This Book
    • Online Resources
  • An Overview of Apple Watch
    • Apple Watch Basics
    • Apple Watch App-Design Concepts
    • From iPhone App to Apple Watch App
    • Wrap-Up
  • Quick Apple Watch Wins
  • WatchKit Extension Overview
    • Creating Your First WatchKit Extension
    • Adding User-Interface Elements
    • The iPhone App—WatchKit Extension Relationship
    • Deployment of WatchKit Apps
    • Adding a Glance
    • Wrap-Up
  • Displaying Your Watch App UI
    • Meet the Interface Objects
    • Creating Interface Objects
    • Designing Your UI in the Storyboard
    • Interface-Object Layout
    • Creating Your Apple Watch App
    • Wrap-Up
  • Organizing Your UI with Groups
    • Group Basics
    • Adding Detail to a Screen
    • Wrap-Up
  • Delivering Dynamic Content with Tables
    • Comparing WatchKit Tables and iOS Table Views
    • Row Types and Storyboard Groups
    • Linking Content to the UI with Row Controllers
    • Configuring the Content in Tables
    • Modifying Tables
    • Considering Table Input
    • Performance Concerns
    • Wrap-Up
  • Navigating Between Interfaces
    • Linking Interfaces in Your Storyboard
    • Interface Transitions in Code
    • Passing Data Between Interfaces
    • Wrap-Up
  • Communicating with the Outside World
  • Your App’s Final Spit and Polish
    • Designing for Both Watch Sizes
    • Using Images Efficiently
    • Localizing and Internationalizing Your App
    • Wrap-Up

Author

Jeff Kelley is an iOS developer at Detroit Labs. He’s been working with iOS since its infancy in 2008, working on award-winning apps including the Domino’s Pizza iOS ordering app and 3D Pizza Builder, the Chevy Game Time second-screen Super Bowl experience, and the DTE Energy outage center app. When not working on iOS apps, Jeff listens to an inordinate amount of podcasts and organizes the Motor City CocoaHeads group in Detroit, MI.