Contents

errorHealthDataRestricted

A Mobile Device Management (MDM) profile restricts the use of HealthKit on this device.

Declaration

static var errorHealthDataRestricted: HKError.Code { get }

Discussion

Because an MDM profile can disable HealthKit on a managed device, always verify that the current device supports HealthKit by calling isHealthDataAvailable() before calling any other HealthKit methods. If HealthKit is restricted (for example, in an enterprise environment), the methods fail with an errorHealthDataRestricted error.

See Also

Accessing errors