<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKStatisticsCollection",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKStatisticsCollection"
  },
  "title" : "HKStatisticsCollection"
}
-->

# HKStatisticsCollection

An object that manages a collection of statistics, representing the results calculated over separate time intervals.

```
class HKStatisticsCollection
```

## Overview

For more information on statistics objects, see [`HKStatistics`](/documentation/HealthKit/HKStatistics). For more information on calculating statistics over consecutive time intervals, see [`HKStatisticsCollectionQuery`](/documentation/HealthKit/HKStatisticsCollectionQuery).

## Topics

### Accessing Statistics Collections

[`-  statistics`](/documentation/HealthKit/HKStatisticsCollection/statistics())

Returns an array of statistics objects representing the populated time intervals covered by the statistics collection query.

[`-  statisticsForDate:`](/documentation/HealthKit/HKStatisticsCollection/statistics(for:))

Returns the statistics object for the time interval that contains the provided date.

[`-  enumerateStatisticsFromDate:toDate:withBlock:`](/documentation/HealthKit/HKStatisticsCollection/enumerateStatistics(from:to:with:))

Enumerates the statistics objects for all the time intervals from the start date until the end date.

### Getting Information About Statistics Collections

[`-  sources`](/documentation/HealthKit/HKStatisticsCollection/sources())

Returns a set containing all the sources that had samples matched by the statistics collection query.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)