Contents

HKObjectType

An abstract superclass with subclasses that identify a specific type of data for the HealthKit store.

Declaration

class HKObjectType

Mentioned in

Overview

The HKObjectType class is an abstract class. Don’t instantiate an HKObjectType object directly. Instead, instantiate one of the following concrete subclasses:

The HKObjectType class provides a convenience method to create each of these subclasses.

Work with Object Types

Like many HealthKit classes, HealthKit object types aren’t extensible. Don’t subclass these classes.

Additionally, wherever possible, this class uses a single instance to represent all copies of the same type. For example, if you make two calls to the quantityType(forIdentifier:) method with the same identifier, the system returns the same instance. Reusing object types helps reduce HealthKit’s overall memory usage.

Topics

Creating quantity types

Creating category types

Creating characteristic types

Creating correlation types

Creating workout types

Creating activity summary types

Creating electrocardiogram types

Creating audiogram sample types

Creating vision prescription types

Creating clinical record types

Creating series types

Creating document types

Getting property data

Initializers

Type Methods

See Also

Object type subclasses