---
title: HKQuantityType
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hkquantitytype
---

# HKQuantityType

A type that identifies samples that store numerical values.

## Declaration

```swift
class HKQuantityType
```

## Mentioned in

Saving data to HealthKit

## Overview

Overview The HKQuantityType class is a concrete subclass of the HKObjectType class. To create a quantity type instance, use the object type’s quantityType(forIdentifier:) convenience method. Use quantity types to: Request permission to read or write matching quantity samples. Create and share matching quantity samples. Query for matching quantity samples.

## Topics

### Creating Quantity Types

- [init(_:)](healthkit/hkquantitytype/init(_:).md)

### Accessing Quantity Type Data

- [aggregationStyle](healthkit/hkquantitytype/aggregationstyle.md)
- [HKQuantityAggregationStyle](healthkit/hkquantityaggregationstyle.md)
- [is(compatibleWith:)](healthkit/hkquantitytype/is(compatiblewith:).md)

## Relationships

### Inherits From

- [HKSampleType](healthkit/hksampletype.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

### Related Documentation

- [HKQuantityTypeIdentifier](healthkit/hkquantitytypeidentifier.md)
- [HKQuantitySample](healthkit/hkquantitysample.md)

### Object type subclasses

- [HKCharacteristicType](healthkit/hkcharacteristictype.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)
- [HKSampleType](healthkit/hksampletype.md)
