Class

HKObject

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

Declaration

@interface HKObject : NSObject

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, HKQuantitySample, HKCorrelation, or 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

Getting Properties

UUID

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

metadata

The metadata for this HealthKit object.

device

The device that generated the data for this object.

source

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

Deprecated
sourceRevision

The app or device that created this object.

Predicate Key Paths

HKPredicateKeyPathUUID

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

HKPredicateKeyPathMetadata

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

Relationships

Inherits From

Conforms To

See Also

Abstract Superclasses

HKQuantitySample

A sample that represents a quantity, including the value and the units.

HKSample

A HealthKit sample represents a piece of data associated with a start and end time.