A sample that contains a workout’s route data.


@interface HKWorkoutRoute : HKSeriesSample


When creating a workout route, you do not instantiate the HKWorkoutRoute objects directly. Instead, create a HKWorkoutRouteBuilder object, and provide it with location data throughout the workout. After the workout ends, call the route builder’s finishRouteWithWorkout:metadata:completion: method to create the route. For detailed instructions, see Creating a Workout Route.

The route’s location data is stored as an array of CLLocation objects. Because the route may contain a large number of location objects, use a HKWorkoutRouteQuery object to asynchronously read the location data from the HealthKit store in batches. For more information, see Reading Route Data.

Using Workout Routes

Like many HealthKit classes, the HKWorkoutRoute class should not be subclassed. You can extend HKWorkoutRoute objects by adding custom metadata keys and values to the metadata dictionary when the object is created.


Inherits From

See Also

Route Data

Creating a Workout Route

Record the user’s route during a workout.

Reading Route Data

Access the user’s route for a workout.


A builder object that incrementally constructs a workout route.


A query to access the location data stored in a workout route.


A series sample containing location data that defines the route the user took during a workout.


An abstract base class for building series samples.


An abstract base class that defines samples that contain a series of items.