---
title: quantity
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkquantitysample/quantity
---

# quantity

The quantity for this sample.

## Declaration

```swift
@NSCopying var quantity: HKQuantity { get }
```

## Discussion

Discussion If the sample contains more than one quantity, this property returns the sum or average, depending on the sample’s aggregation style (sum for cumulative, average for discrete). To access the individual quantities, use an HKQuantitySeriesSampleQuery. To see the type of units compatible with this quantity, look up the sample’s quantity type identifier in HKQuantityTypeIdentifier.

## See Also

### Getting Property Data

- [count](healthkit/hkquantitysample/count.md)
- [quantityType](healthkit/hkquantitysample/quantitytype.md)
