---
title: HKError.Code.errorHealthDataUnavailable
framework: healthkit
role: symbol
role_heading: Case
path: healthkit/hkerror/code/errorhealthdataunavailable
---

# HKError.Code.errorHealthDataUnavailable

HealthKit accessed on an unsupported device, such as an iPad.

## Declaration

```swift
case errorHealthDataUnavailable
```

## 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

### Errors

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