Enumeration

HKError.Code

Error codes that may be returned when calling HealthKit methods.

Topics

Constants

case noError

No error occurred.

case errorHealthDataUnavailable

HealthKit is restricted on this device.

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 errorRequiredAuthorizationDenied

An error indicating that the user has not granted the application authorization to access all the required data types.

Beta
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

Errors

struct HKError

An error returned from a HealthKit method.

let HKErrorDomain: String

The domain for all HealthKit errors.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software