---
title: HKSampleType
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hksampletype
---

# HKSampleType

An abstract superclass for all classes that identify a specific type of sample when working with the HealthKit store.

## Declaration

```swift
class HKSampleType
```

## Mentioned in

Saving data to HealthKit

## Overview

Overview The HKSampleType class is an abstract subclass of the HKObjectType class, used to represent data samples. Never instantiate an HKSampleType object directly. Instead, work with one of its concrete subclasses: HKCategoryType, HKCorrelationType, HKQuantityType, or HKWorkoutType classes.

## Topics

### Checking the Duration Restriction

- [isMinimumDurationRestricted](healthkit/hksampletype/isminimumdurationrestricted.md)
- [minimumAllowedDuration](healthkit/hksampletype/minimumallowedduration.md)
- [isMaximumDurationRestricted](healthkit/hksampletype/ismaximumdurationrestricted.md)
- [maximumAllowedDuration](healthkit/hksampletype/maximumallowedduration.md)

### Checking on Recalibrating Estimates

- [allowsRecalibrationForEstimates](healthkit/hksampletype/allowsrecalibrationforestimates.md)

## Relationships

### Inherits From

- [HKObjectType](healthkit/hkobjecttype.md)

### Inherited By

- [HKAudiogramSampleType](healthkit/hkaudiogramsampletype.md)
- [HKCategoryType](healthkit/hkcategorytype.md)
- [HKClinicalType](healthkit/hkclinicaltype.md)
- [HKCorrelationType](healthkit/hkcorrelationtype.md)
- [HKDocumentType](healthkit/hkdocumenttype.md)
- [HKElectrocardiogramType](healthkit/hkelectrocardiogramtype.md)
- [HKMedicationDoseEventType](healthkit/hkmedicationdoseeventtype.md)
- [HKPrescriptionType](healthkit/hkprescriptiontype.md)
- [HKQuantityType](healthkit/hkquantitytype.md)
- [HKScoredAssessmentType](healthkit/hkscoredassessmenttype.md)
- [HKSeriesType](healthkit/hkseriestype.md)
- [HKStateOfMindType](healthkit/hkstateofmindtype.md)
- [HKWorkoutType](healthkit/hkworkouttype.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)
- [HKObjectType](healthkit/hkobjecttype.md)
