Metadata Keys

A set of predefined keys for adding metadata to HealthKit objects. Use these keys to facilitate sharing data between apps. You can also create your own custom keys to give HealthKit objects additional app-specific data.

Topics

Constants

let HKMetadataKeyDeviceSerialNumber: String

The key for the serial number of the device that generated the data.

let HKMetadataKeyBodyTemperatureSensorLocation: String

The location where a particular body temperature reading was taken.

let HKMetadataKeyHeartRateSensorLocation: String

The location where a particular heart rate reading was taken.

let HKMetadataKeyHeartRateMotionContext: String

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

let HKMetadataKeyFoodType: String

The type of food that the HealthKit object represents.

let HKMetadataKeyUDIDeviceIdentifier: String

The device identifier portion of a device’s UDI (unique device identifier).

let HKMetadataKeyUDIProductionIdentifier: String

The production identifier portion of a device’s UDI (unique device identifier).

let HKMetadataKeyDigitalSignature: String

A digital signature that can be used to validate the origin of the HealthKit object.

let HKMetadataKeyExternalUUID: String

A unique identifier for an HKObject that is set by its source.

let HKMetadataKeyTimeZone: String

The user’s time zone when the HealthKit object was created.

let HKMetadataKeyDeviceName: String

The name of the device that took this reading.

let HKMetadataKeyDeviceManufacturerName: String

The name of the manufacturer of the device that took this reading.

let HKMetadataKeyWasTakenInLab: String

A key that indicates whether the sample was taken in a lab.

let HKMetadataKeyReferenceRangeLowerLimit: String

A key that indicates the lower limit of the reference range for a lab result.

let HKMetadataKeyReferenceRangeUpperLimit: String

A key that indicates the upper limit of the reference range for a lab result.

let HKMetadataKeyWasUserEntered: String

A key that indicates whether the sample was entered by the user.

let HKMetadataKeyWorkoutBrandName: String

The brand name of a particular workout.

let HKMetadataKeyGroupFitness: String

A key that indicates whether the workout was performed as part of a group fitness class.

let HKMetadataKeyIndoorWorkout: String

A key that indicates whether the workout was performed indoors.

let HKMetadataKeyCoachedWorkout: String

A key that indicates whether the workout was performed with a coach or personal trainer.

let HKMetadataKeyMenstrualCycleStart: String

A key that indicates whether the sample represents the start of a menstrual cycle. This metadata key is required for menstrualFlow category samples.

let HKMetadataKeySexualActivityProtectionUsed: String

A key that indicates whether protection was used during sexual activity. This metadata key can be used with sexualActivity category samples.

let HKMetadataKeyWeatherCondition: String

A key that represents the weather condition during the sample.

let HKMetadataKeyWeatherTemperature: String

A key that represents the weather temperature during the sample.

let HKMetadataKeyWeatherHumidity: String

A key that represents the weather humidity during the sample.

See Also

Metadata Keys and Values

enum HKBodyTemperatureSensorLocation

Constants that indicate where on the body a temperature reading was taken.

enum HKHeartRateSensorLocation

Constants that indicate where on the body the heart rate sensor is located.

enum HKHeartRateMotionContext

Values that indicate the user’s level of activity when the heart rate sample was measured.

enum HKWeatherCondition

Constants that indicate a type of weather.