Error codes that may be returned when calling HealthKit methods.



case noError

No error occurred.

case errorHealthDataUnavailable

HealthKit is not available on this device. HealthKit is not available on iPad.

case errorHealthDataRestricted

HealthKit is restricted on this device.

case errorInvalidArgument

An invalid argument was provided to the HealthKit API.

case errorAuthorizationDenied

The user has not given the app permission to perform the requested operation.

case errorAuthorizationNotDetermined

Your app has not yet asked the user for the authorization required to complete this task.

case errorDatabaseInaccessible

The HealthKit data is unavailable because the HealthKit data is protected and the device is locked.

case errorUserCanceled

The user canceled the operation.

case errorAnotherWorkoutSessionStarted

Another app has started a workout session.

case errorUserExitedWorkoutSession

The user exited your application while a workout session was running.

See Also

Other HealthKit Constants

Health Kit Error Domain

Constant for the HealthKit error domain.

enum HKUpdateFrequency

Constants that determine how often the system will launch your app in response to changes to HealthKit data. For more information, see HKObserverQuery.

enum HKAuthorizationStatus

Constants indicating the authorization status for a particular data type.

enum HKFitzpatrickSkinType

Categories representing the user’s skin type based on the Fitzpatrick scale. The Fitzpatrick scale is a numerical classification for skin color based on the skins response to sun exposure in terms of the degree of burning and tanning.

enum HKCategoryValueSleepAnalysis

Categories used when analyzing sleep samples.

enum HKCategoryValueAppleStandHour

Categories used to indicate whether the user stood during the sample’s duration.

enum HKCategoryValueCervicalMucusQuality

Categories used to represent the user’s cervical mucus quality. These values are ordered from least-fertile (Dry) to most-fertile (EggWhite).

enum HKCategoryValueOvulationTestResult

Categories used to represent the result of an ovulation home test.

enum HKCategoryValueMenstrualFlow

Constants indicating the amount of menstrual flow for a given sample.

enum HKCategoryValue

Miscellaneous category values.

enum HKBiologicalSex

Constants indicating the user’s sex. A person's sex is a combination of bodily characteristics including: chromosomes, hormones, internal and external reproductive organs, and secondary sex characteristics.

enum HKBloodType

Constants indicating the user’s blood type.

enum HKWheelchairUse

Constants indicating the user’s wheelchair use.