watchOS 3.0

This article summarizes the key developer-related features introduced in watchOS 3, which runs on currently shipping watchOS devices. The article also lists the documents that describe new features in more detail.

For late-breaking news and information about known issues, see Release Notes at https://developer.apple.com/watchos/download/. For the complete list of new APIs added in watchOS 3, see watchOS 3.0 API Diffs.

To learn about what’s new in Swift, see Swift Language and The Swift Programming Language (Swift 4).

Snapshots and the Dock

watchOS 3 introduces the Dock, which provides a quick way for users to view and launch their favorite apps. After pressing the side button to reveal the Dock, users scroll through it to view snapshots of their favorite apps. When users stop scrolling and let the Dock settle for a moment, the currently displayed app wakes and its snapshot is replaced by the running app.

The system automatically takes periodic snapshots of your app and uses them to populate the Dock and to serve as your app’s launch image. You can update both the currently presented interface controller and the controller’s content before the snapshot is taken. To learn more, see WKSnapshotRefreshBackgroundTask.

Background Tasks

Background tasks give your app time to run in the background and ensure that the information users want is available before they open your app. watchOS 3 introduces several types of background tasks:

To learn more about handling background tasks in general, see Background Refresh Tasks.

Complications Enhancements

Complications are small visual elements that appear directly on the watch face. In watchOS 3, creating one or more complications gives your app the opportunity to provide vital pieces of information to users whenever they glance at the watch face.

There are several reasons why you should take advantage of the enhanced complications APIs in watchOS 3:

In watchOS 3, you can use WKApplicationRefreshBackgroundTask to update complications.

The ClockKit framework (ClockKit.framework) includes several new templates for the extra large complications family, such as CLKComplicationTemplateExtraLargeColumnsText and CLKComplicationTemplateExtraLargeRingImage. In addition, the CLKTextProvider class introduces methods you can use to create localizable text providers, such as localizableTextProviderWithStringsFileTextKey:.

User Notifications

watchOS 3 introduces the User Notifications framework (UserNotifications.framework), which supports the delivery and handling of local and remote notifications. You can use the classes of this framework to schedule the delivery of local notifications based on specific conditions, such as a date or time or after a time interval, and to receive and handle local and remote notifications when they are delivered to the user’s device. To learn more, see User Notifications Framework Reference.

Proactive Suggestions

In watchOS 3, the NSUserActivity object includes the mapItem property, which lets you provide location information that can be used in other contexts. For example, if your app displays hotel reviews, you can use the mapItem property to hold the location of the hotel the user is viewing so that when the user switches to a travel planning app, that hotel’s location is automatically available.

Apple Pay Enhancements

In watchOS 3, the PassKit framework (PassKit.framework) adds support for in-app payments on Apple Watch. In-app payments allow users to securely provide payment and contact information to pay for physical goods and services.

Specifically, PassKit introduces the new PKPaymentAuthorizationController class, which presents an interface in which the user can authorize a payment request, and the PKPaymentAuthorizationControllerDelegate protocol, which you implement to respond to user interaction with the payment authorization controller object. To learn about additional changes in the PassKit framework, see PassKit.

Enhancements for Workout Apps

In watchOS 3, workout apps can run in the background. To enable your workout app to run in the background and access HealthKit data, you must add the WKBackgroundModes key to your Info.plist file and give it the value workout-processing.

You can also launch your watchOS workout app from your iOS app. In your iOS app, call the new startWatchAppWithWorkoutConfiguration:completion: method to launch (or wake up) your workout app on the paired Apple Watch. To learn about additional API changes in the HealthKit framework, see HealthKit.

WatchKit Framework Enhancements

In addition to classes that support background tasks (described in Background Tasks), the WatchKit framework (WatchKit.framework) also includes the following enhancements:

Watch Connectivity Framework Enhancements

The WCSession class introduces the hasContentPending property, which indicates whether the session has data received in the background that still needs to be delivered to the delegate. WCSession also defines the remainingComplicationUserInfoTransfers property, which indicates the remaining number of times you can send complication data from your iOS app to your WatchKit extension.

Security and Privacy Enhancements

watchOS 3 introduces several changes and additions that help you improve the security of your code and maintain the privacy of user data. To learn more about these items, see https://developer.apple.com/security/.

Existing Frameworks Now Available in watchOS

watchOS 3 includes several frameworks that currently exist on other platforms.

The SceneKit framework (SceneKit.framework) lets you integrate 3D models into your app’s UI. SceneKit combines a high-performance rendering engine with a high-level, descriptive API and supports the import, manipulation, and rendering of 3D assets.

Use the WKInterfaceSCNScene class to add live 3D rendered content to your watchOS app or game. In the WatchKit interface, display content by assigning an SCNScene object, which is loaded from a .scn file created in Xcode and bundled in your Watch app’s resources.

SceneKit in watchOS supports most of the features you use on other platforms, including lighting and shading, animation, physics, and particle systems, with the following exceptions:

The SpriteKit framework (SpriteKit.framework) is a graphics rendering and animation infrastructure that you can use to animate arbitrary textured images, also known as sprites.

Use the WKInterfaceSKScene class to add interactive 2D animation to your watchOS app or game. In the WatchKit interface, display content by assigning an SKScene object, which is loaded from a .sks file created in Xcode and bundled in your Watch app’s resources.

SpriteKit in watchOS supports most of the features you use on other platforms, including actions, physics, lighting, and particle systems, with the following exceptions:

The AVFoundation framework (AVFoundation.framework) helps you manage and play audio.

The CloudKit Framework (CloudKit.framework) provides interfaces for moving data between your app and your iCloud containers.

The Core Audio framework (CoreAudio.framework) provides data types that help you represent audio streams, complex buffers, and time values.

The GameKit framework (GameKit.framework) helps you create great social games.

Additional Framework Enhancements

In addition to the major changes described above, watchOS 3 includes many other improvements.

Core Data

The Core Data framework (CoreData.framework) includes the following enhancements:

  • NSPersistentStoreCoordinator now maintains a connection pool for SQLite stores. Root NSManagedObjectContext objects (those without parent MOCs) transparently support concurrent fetching and faulting without serializing against each other.

  • NSManagedObjectContext objects with SQLite stores in WAL journal_mode support a new feature called query generations. These allow a MOC to be pinned to a version of the database at a point in time and perform all future fetching and faulting against that version of the database. Pinned MOCs are moved to the most recent transaction with any save, and query generations do not survive the process's life time.

  • The new NSPersistentContainer class provides your app with a high-level integration point that maintains references to your NSPersistentStoreCoordinator, NSManagedObjectModel, and other configuration resources.

  • Core Data now has tighter integration with Xcode and automatically generates and updates your NSManagedObject subclasses.

  • NSManagedObject includes several additional convenience methods, making it easier to fetch and create subclasses. NSManagedObject subclasses that have a 1:1 relationship with an entity now support entity.

  • Core Data introduces several API adjustments that provide better integration with Swift, including parameterized NSFetchRequest objects.

For more information, see Core Data Framework Reference.

Core Motion

The Core Motion framework (CoreMotion.framework) includes the following enhancements:

  • The new CMSignificantElevationSample class represents a sample in which there has been a significant change in the user’s elevation.

  • The new CMPedometerEvent class represents an event that marks a change in the user’s pedestrian activity. You can use this class to receive real-time notifications when users pause and resume while they’re walking and running.

Foundation

The Foundation framework (Foundation.framework) contains many enhancements, such as:

  • The new NSDateInterval class defines a programmatic interface for calculating the duration of a time interval and determining whether a date falls within it, as well as comparing date intervals and checking to see whether they intersect.

  • The NSLocale class defines many new properties that you can use to get information about a locale and how it can be displayed.

  • The new NSMeasurement class helps you convert measurements into different units, and calculate the sum or difference between two measurements. The new NSMeasurementFormatter class helps you create localized representations of measurements when displaying quantities of units to the user.

  • The new NSUnit class and concrete NSDimension subclasses help you represent specific units of measure.

HealthKit

In addition to additional support for workout apps (to learn more, see Enhancements for Workout Apps), the HealthKit framework (HealthKit.framework) includes the following changes and enhancements:

HomeKit

The HomeKit framework (HomeKit.framework) supports camera and doorbell accessories and introduces many new APIs that help you:

  • View and interact with IP camera accessory profiles, display live streams and snapshots, and control a camera’s settings, speaker, and microphone

  • Access new services and characteristics

  • For the primary service, link services and valid values to provide more context and configuration about the accessories

To learn more, see HomeKit Framework Reference.

PassKit

In watchOS 3, the PassKit framework (PassKit.framework) supports in-app payments on Apple Watch (to learn more, see Apple Pay Enhancements). In addition, the framework includes several classes that were available on other platforms, such as PKPayment, PKPaymentMethod, PKPaymentRequest, and PKPaymentToken.

UIKit

The UIKit framework (UIKit.framework) includes the following changes: