Type Property

menstrualFlow

A category sample type for representing menstrual cycles.

Declaration

static let menstrualFlow: HKCategoryTypeIdentifier

Discussion

These samples use values from the HKCategoryValueMenstrualFlow enum. Additionally, these samples must include HKMetadataKeyMenstrualCycleStart metadata.

When recording data about the user’s menstrual cycle, you can either use a single sample for the entire period, or multiple samples to record changes over the cycle. When using single samples, pass the start of the menstrual period to the startDate parameter. Pass the end of the period to the endDate parameter, and set the HKMetadataKeyMenstrualCycleStart value to true.

When using multiple samples to record a single period, the startDate and endDate parameters should mark the beginning and ending of each individual sample. Set the HKMetadataKeyMenstrualCycleStart value for the first sample in the period to true. Use false for any additional samples. Different samples can use different menstrualFlow values to record the changes in flow over time.

Topics

Metadata Keys

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.

See Also

Reproductive Health

static let cervicalMucusQuality: HKCategoryTypeIdentifier

A category sample type for representing the quality of the user’s cervical mucus.

static let intermenstrualBleeding: HKCategoryTypeIdentifier

A category sample type for representing spotting outside the normal menstruation period.

static let ovulationTestResult: HKCategoryTypeIdentifier

A category sample type for recording the result of an ovulation home test.

static let sexualActivity: HKCategoryTypeIdentifier

A category sample type for recording sexual activity.