Version First Edition
Platform watchOS 8
Language Swift 5.5
Editor Xcode 13.1

Build amazing apps with SwiftUI for Apple Watch

The Apple Watch is, by far, the most common smart watch in the market. Its sales have even surpased those of its analog competitors. With this book you will learn how to develop native watchOS applications for this popular device. And at the same time, to do so, you will be using one of the newest and most moderns UI frameworks developed by Apple, SwiftUI.

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

i

iii

iv

v

Section I: watchOS With SwiftUI

Create your first Apple Watch application and learn how SwiftUI now integrates seamlessly between all your apps. No need to learn specific watchOS code.

1

Apple Watch apps have a slightly different project structure compared to iOS. In this chapter you will learn those differences, so you can create a standalone WatchOS app, or an iPhone companion app.

2

Learn how to use the scrolling digital crown in your WatchOS application and implement it by building the classic Pong video game.

3

In this chapter, learn about the Watch Connectivity framework and the different ways you can transfer data between iOS and watchOS apps and how to successfully implement it.

4

Snapshots provide a way for users to quickly view the state of an app. Great apps should always show updated information in their snapshots. So in this chapter you will learn how to make sure it shows the latest and most useful information to the user.

5

watchOS offers support for several different types of notifications and allows you to customize them to the individual needs of your watch app. In this chapter, you'll get a complete overview.

6

Find out about the Apple Watch Lifecycles and how it transitions between states while building a useful app to explain how to extend current runtime sessions.

7

A quick introduction to what a complication is, including graphics showing the location of each type.

8

Complications are small elements that appear on the user's selected watch face and provide quick access to frequently used data from within your app. This chapter will walk you through the process of setting up your first complication, along with introducing each of the complication families and their corresponding layout templates.

9

Use background tasks and background URL downloads to keep your complications up to date.

10

The Apple Watch allows users to select a specific tint color for the watch face. In this chapter you will learn how to prepare your complications for great results by applying multi-layered images, SwiftUI graphic views or conditional rendering modes.

11

Learn how to create complications using SwiftUI.

12

Learn how you can easily share your own custom Watch Faces through your iOS device or via web.

13

Learn how to use Sign in with Apple to allow simple and straight-forward registration and authentication.

14

Implement HealthKit in your WatchOS app to track health-related information and take advantage of Apple Health capabilities.

15

Meet the team

Contributors

Who is this book for

This book is for beginner and intermediate developers who wish to know how to develop watchOS apps in a declarative and modern way by implementing SwiftUI.

Concepts covered in this book

  • watchOS app project structure
  • How to use the Digital Crown in your apps
  • Watch Connectivity
  • Why your app should implement Snapshots
  • Notifications
  • Understand the watchOS app Lifecycle
  • All you need to know about Complications
  • Watch Face sharing
  • Signing in with Apple Watch
  • HealthKit

Reviews

Version history

First Edition · watchOS 8, Swift 5.5, Xcode 13.1

v1.0 · Dec 1 2021 · Scott Grosch
See book details
Pro
New

watchOS With SwiftUI by Tutorials

By Scott Grosch

Learn how to build amazing apps with SwiftUI for your Apple Watch.

Read for Free with an Ultimate Pro Subscription* * Includes this and all other books in our online library See all benefits
Buy Individually $59.99* *Includes access to all of our online reading features.
See buying options
Hide buying options

All videos. All books.
One low price.

A raywenderlich.com subscription is the best way to learn and master mobile development — plans start at just $19.99/month!

Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.