---
title: errorHealthDataUnavailable
framework: healthkit
role: symbol
role_heading: Type Property
path: healthkit/hkerror/errorhealthdataunavailable
---

# errorHealthDataUnavailable

The user accessed HealthKit on an unsupported device.

## Declaration

```swift
static var errorHealthDataUnavailable: HKError.Code { get }
```

## Discussion

Discussion Because iOS apps can run on devices that don’t support HealthKit (for example, on an iPad), always verify that the current device supports HealthKit by calling isHealthDataAvailable() before calling any other HealthKit methods. If HealthKit isn’t available on the device, other HealthKit methods fail with an errorHealthDataUnavailable error.

## See Also

### Accessing errors

- [HKError.Code](healthkit/hkerror/code.md)
- [noError](healthkit/hkerror/noerror.md)
- [errorHealthDataRestricted](healthkit/hkerror/errorhealthdatarestricted.md)
- [errorInvalidArgument](healthkit/hkerror/errorinvalidargument.md)
- [errorAuthorizationDenied](healthkit/hkerror/errorauthorizationdenied.md)
- [errorAuthorizationNotDetermined](healthkit/hkerror/errorauthorizationnotdetermined.md)
- [errorRequiredAuthorizationDenied](healthkit/hkerror/errorrequiredauthorizationdenied.md)
- [errorDatabaseInaccessible](healthkit/hkerror/errordatabaseinaccessible.md)
- [errorUserCanceled](healthkit/hkerror/errorusercanceled.md)
- [errorAnotherWorkoutSessionStarted](healthkit/hkerror/erroranotherworkoutsessionstarted.md)
- [errorUserExitedWorkoutSession](healthkit/hkerror/erroruserexitedworkoutsession.md)
- [errorNoData](healthkit/hkerror/errornodata.md)
