<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKQuantitySample/count",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKQuantitySample(py)count"
  },
  "title" : "count"
}
-->

# count

The number of quantities contained in this sample.

```
var count: Int { get }
```

## Discussion

Samples created using one of the `init()` methods have a [`count`](/documentation/HealthKit/HKQuantitySample/count) of `1`. Samples created using an [`HKQuantitySeriesSampleBuilder`](/documentation/HealthKit/HKQuantitySeriesSampleBuilder) may have a [`count`](/documentation/HealthKit/HKQuantitySample/count) greater than `1`.

## See Also

[`class HKQuantitySeriesSampleQuery`](/documentation/HealthKit/HKQuantitySeriesSampleQuery)

A query that accesses the series data associated with a quantity sample.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)