---
title: HKWorkoutRoute
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkworkoutroute
---

# HKWorkoutRoute

A sample that contains a workout’s route data.

## Declaration

```swift
class HKWorkoutRoute
```

## Mentioned in

Reading route data Creating a workout route

## Overview

Overview 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  finishRoute(with: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 As with many HealthKit classes, don’t subclass the HKWorkoutRoute class. You can extend HKWorkoutRoute objects by adding custom metadata keys and values to the metadata dictionary when the object is created.

## Relationships

### Inherits From

- [HKSeriesSample](healthkit/hkseriessample.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Route data

- [Creating a workout route](healthkit/creating-a-workout-route.md)
- [Reading route data](healthkit/reading-route-data.md)
- [HKWorkoutRouteBuilder](healthkit/hkworkoutroutebuilder.md)
- [HKWorkoutRouteQueryDescriptor](healthkit/hkworkoutroutequerydescriptor.md)
- [HKWorkoutRouteQuery](healthkit/hkworkoutroutequery.md)
- [HKWorkoutRouteTypeIdentifier](healthkit/hkworkoutroutetypeidentifier.md)
- [HKSeriesBuilder](healthkit/hkseriesbuilder.md)
- [HKSeriesSample](healthkit/hkseriessample.md)
