HKObjectType
An abstract superclass with subclasses that identify a specific type of data for the HealthKit store.
Declaration
class HKObjectTypeMentioned 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.