Contents

dateOfBirthComponents()

Reads the user’s date of birth from the HealthKit store as date components.

Declaration

func dateOfBirthComponents() throws -> DateComponents

Return Value

An NSDateComponents object representing the user’s birthdate in the Gregorian calendar, or nil.

Discussion

If the user has not yet specified a birth date, or if the user has denied your app permission to read the birth date, this method returns nil.

See Also

Reading characteristic data