---
title: initialResultsHandler
framework: healthkit
role: symbol
role_heading: Instance Property
path: healthkit/hkstatisticscollectionquery/initialresultshandler
---

# initialResultsHandler

The results handler for the query’s initial results.

## Declaration

```swift
var initialResultsHandler: (@Sendable (HKStatisticsCollectionQuery, HKStatisticsCollection?, (any Error)?) -> Void)? { get set }
```

## Discussion

Discussion If this property is not set to nil, the query executes the results handler on a background queue after it has finished calculating the statistics for all matching samples currently stored in HealthKit.

## See Also

### Getting and Setting Results Handlers

- [statisticsUpdateHandler](healthkit/hkstatisticscollectionquery/statisticsupdatehandler.md)
