---
title: HKObjectType
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkobjecttype
---

# HKObjectType

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

## Declaration

```swift
class HKObjectType
```

## Mentioned in

Saving data to HealthKit About the HealthKit framework

## Overview

Overview The HKObjectType class is an abstract class. Don’t instantiate an HKObjectType object directly. Instead, instantiate one of the following concrete subclasses: HKActivitySummaryType HKCategoryType HKCorrelationType HKCharacteristicType HKDocumentType HKQuantityType HKSeriesType HKWorkoutType 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

- [quantityType(forIdentifier:)](healthkit/hkobjecttype/quantitytype(foridentifier:).md)
- [HKQuantityTypeIdentifier](healthkit/hkquantitytypeidentifier.md)

### Creating category types

- [categoryType(forIdentifier:)](healthkit/hkobjecttype/categorytype(foridentifier:).md)
- [HKCategoryTypeIdentifier](healthkit/hkcategorytypeidentifier.md)

### Creating characteristic types

- [characteristicType(forIdentifier:)](healthkit/hkobjecttype/characteristictype(foridentifier:).md)
- [HKCharacteristicTypeIdentifier](healthkit/hkcharacteristictypeidentifier.md)

### Creating correlation types

- [correlationType(forIdentifier:)](healthkit/hkobjecttype/correlationtype(foridentifier:).md)
- [HKCorrelationTypeIdentifier](healthkit/hkcorrelationtypeidentifier.md)

### Creating workout types

- [workoutType()](healthkit/hkobjecttype/workouttype().md)

### Creating activity summary types

- [activitySummaryType()](healthkit/hkobjecttype/activitysummarytype().md)

### Creating electrocardiogram types

- [electrocardiogramType()](healthkit/hkobjecttype/electrocardiogramtype().md)

### Creating audiogram sample types

- [audiogramSampleType()](healthkit/hkobjecttype/audiogramsampletype().md)

### Creating vision prescription types

- [visionPrescriptionType()](healthkit/hkobjecttype/visionprescriptiontype().md)

### Creating clinical record types

- [clinicalType(forIdentifier:)](healthkit/hkobjecttype/clinicaltype(foridentifier:).md)

### Creating series types

- [seriesType(forIdentifier:)](healthkit/hkobjecttype/seriestype(foridentifier:).md)

### Creating document types

- [documentType(forIdentifier:)](healthkit/hkobjecttype/documenttype(foridentifier:).md)
- [HKDocumentTypeIdentifier](healthkit/hkdocumenttypeidentifier.md)

### Getting property data

- [identifier](healthkit/hkobjecttype/identifier.md)
- [requiresPerObjectAuthorization()](healthkit/hkobjecttype/requiresperobjectauthorization().md)

### Initializers

- [init(coder:)](healthkit/hkobjecttype/init(coder:).md)

### Type Methods

- [medicationDoseEventType()](healthkit/hkobjecttype/medicationdoseeventtype().md)
- [stateOfMindType()](healthkit/hkobjecttype/stateofmindtype().md)
- [userAnnotatedMedicationType()](healthkit/hkobjecttype/userannotatedmedicationtype().md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [HKActivitySummaryType](healthkit/hkactivitysummarytype.md)
- [HKCharacteristicType](healthkit/hkcharacteristictype.md)
- [HKSampleType](healthkit/hksampletype.md)
- [HKUserAnnotatedMedicationType](healthkit/hkuserannotatedmedicationtype.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Object type subclasses

- [HKCharacteristicType](healthkit/hkcharacteristictype.md)
- [HKQuantityType](healthkit/hkquantitytype.md)
- [HKCategoryType](healthkit/hkcategorytype.md)
- [HKCorrelationType](healthkit/hkcorrelationtype.md)
- [HKActivitySummaryType](healthkit/hkactivitysummarytype.md)
- [HKAudiogramSampleType](healthkit/hkaudiogramsampletype.md)
- [HKElectrocardiogramType](healthkit/hkelectrocardiogramtype.md)
- [HKSeriesType](healthkit/hkseriestype.md)
- [HKClinicalType](healthkit/hkclinicaltype.md)
- [HKWorkoutType](healthkit/hkworkouttype.md)
- [HKSampleType](healthkit/hksampletype.md)
