---
title: HKMetadataKeyHeartRateMotionContext
framework: healthkit
role: symbol
role_heading: Global Variable
path: healthkit/hkmetadatakeyheartratemotioncontext
---

# HKMetadataKeyHeartRateMotionContext

The user’s activity level when the heart rate sample was measured.

## Declaration

```swift
let HKMetadataKeyHeartRateMotionContext: String
```

## Discussion

Discussion This key takes an NSNumber containing an HKHeartRateMotionContext as its value.

## Topics

### Valid Motion Contexts

- [HKHeartRateMotionContext](healthkit/hkheartratemotioncontext.md)

## See Also

### Related Documentation

- [heartRate](healthkit/hkquantitytypeidentifier/heartrate.md)

### Metadata Keys

- [HKMetadataKeyHeartRateSensorLocation](healthkit/hkmetadatakeyheartratesensorlocation.md)
