<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKObject",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKObject"
  },
  "title" : "HKObject"
}
-->

# HKObject

A piece of data that can be stored inside the HealthKit store.

```
class HKObject
```

## Overview

The `HKObject` class is an abstract class. You should never instantiate a `HKObject` object directly. Instead, always work with one of its concrete subclasses: [`HKCategorySample`](/documentation/HealthKit/HKCategorySample), [`HKQuantitySample`](/documentation/HealthKit/HKQuantitySample), [`HKCorrelation`](/documentation/HealthKit/HKCorrelation), or [`HKWorkout`](/documentation/HealthKit/HKWorkout).

HealthKit objects are all immutable. With a few exceptions (such as the object’s source revision), the object’s properties are set when the object is first created and they cannot change.

## Topics

### Accessing Properties

[`UUID`](/documentation/HealthKit/HKObject/uuid)

The universally unique identifier (UUID) for this HealthKit object.

[`metadata`](/documentation/HealthKit/HKObject/metadata)

The metadata for this HealthKit object.

[`device`](/documentation/HealthKit/HKObject/device)

The device that generated the data for this object.

[`sourceRevision`](/documentation/HealthKit/HKObject/sourceRevision)

The app or device that created this object.

[`source`](/documentation/HealthKit/HKObject/source)

A HealthKit source, representing the app or device that created this object.

### Specifying Predicate Key Paths

[`HKPredicateKeyPathUUID`](/documentation/HealthKit/HKPredicateKeyPathUUID)

The key path for accessing the object’s UUID inside a predicate format string.

[`HKPredicateKeyPathMetadata`](/documentation/HealthKit/HKPredicateKeyPathMetadata)

The key path for accessing the object’s metadata dictionary inside a predicate format string.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherited By

[`HKSample`](/documentation/HealthKit/HKSample)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)