---
title: About the HealthKit framework
framework: healthkit
role: article
role_heading: Article
path: healthkit/about-the-healthkit-framework
---

# About the HealthKit framework

Learn about the architecture and design of the HealthKit framework.

## Overview

Overview Share health and fitness data between apps using the HealthKit framework. Rather than developers creating custom data types and units, HealthKit constrains data types and units to a predefined list. This ensures that all apps understand what the data means and how they can use it. Additionally, the framework uses a large number of subclasses, producing deep hierarchies of similar classes. Often, these classes have subtle but important differences between them. For example, you use an HKQuantitySample object to store data with a numeric value and an HKCategorySample object to store a value selected from an enumeration. HealthKit also uses pairs of closely related classes that you need to use together. For example, the HKObject and HKObjectType abstract classes have largely parallel hierarchies of concrete subclasses. When working with objects and object types, you must use matching subclasses. HealthKit data HealthKit saves a variety of data types in the HealthKit Store: Properties of objects and samples The HKObject class is the superclass of all HealthKit sample types. All HKObject subclasses are immutable. Each object has the following properties: The HKSample class is a subclass of HKObject. Sample objects represent data at a particular point in time, and all sample objects are subclasses of the HKSample class. They have the following properties: Samples are further divided into four concrete subclasses: Threading The HealthKit store is thread-safe, and most HealthKit objects are immutable. In general, you can use HealthKit safely in a multithreaded environment. note: All the HealthKit API’s completion handlers execute on private background queues. You typically dispatch this data back to the main queue before updating your user interface or changing any other resources that you can only safely modify from the main thread. For more information about multithreading and concurrent programming, see Concurrency Programming Guide. Syncing data between devices iPhone, Apple Watch, and visionOS each have their own HealthKit store. iPadOS 17 and later also has its own HealthKit store. It is also available on iPadOS apps running on Vision Pro. HealthKit automatically syncs data between these devices. To save space, old data is periodically purged from Apple Watch. Use earliestPermittedSampleDate() to determine the earliest samples available on Apple Watch. While the HealthKit framework is available on iPadOS 16 and earlier and on MacOS 13 and later, these devices don’t have a copy of the HealthKit store. This means you can include HealthKit code in apps running on these devices, simplifying the creation of multiplatform apps. However, they can’t read or write HealthKit data, and calls to isHealthDataAvailable() return false.

## See Also

### Essentials

- [Setting up HealthKit](healthkit/setting-up-healthkit.md)
- [Authorizing access to health data](healthkit/authorizing-access-to-health-data.md)
- [Protecting user privacy](healthkit/protecting-user-privacy.md)
- [HealthKit updates](updates/healthkit.md)
- [HealthKitUI](healthkitui.md)
