---
title: totalDistance
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkworkout/totaldistance
---

# totalDistance

The total distance traveled during the workout.

## Declaration

```swift
var totalDistance: HKQuantity? { get }
```

## Mentioned in

Adding samples to a workout

## Discussion

Discussion This property contains a quantity using length units, or nil. note: Provide a total distance value whenever the distance traveled is relevant to the workout type. In addition, add distance samples to a workout using the add(_:to:completion:) method. These samples should sum up to the total distance, while providing detailed information about how the intensity changes over the duration of the workout.

## See Also

### Accessing workout data

- [duration](healthkit/hkworkout/duration.md)
- [workoutActivityType](healthkit/hkworkout/workoutactivitytype.md)
- [workoutActivities](healthkit/hkworkout/workoutactivities.md)
- [workoutEvents](healthkit/hkworkout/workoutevents.md)
- [statistics(for:)](healthkit/hkworkout/statistics(for:).md)
- [allStatistics](healthkit/hkworkout/allstatistics.md)
- [totalEnergyBurned](healthkit/hkworkout/totalenergyburned.md)
- [totalFlightsClimbed](healthkit/hkworkout/totalflightsclimbed.md)
- [totalSwimmingStrokeCount](healthkit/hkworkout/totalswimmingstrokecount.md)
