---
title: HKHeartbeatSeriesQueryDescriptor
framework: healthkit
role: symbol
role_heading: Structure
path: healthkit/hkheartbeatseriesquerydescriptor
---

# HKHeartbeatSeriesQueryDescriptor

A query interface that reads the heartbeat series data stored in a heartbeat sample using Swift concurrency.

## Declaration

```swift
struct HKHeartbeatSeriesQueryDescriptor
```

## Overview

Overview Use HKHeartbeatSeriesQueryDescriptor to read the heartbeat data included in a HKHeartbeatSeriesSample. To read the individual heartbeats, create a heartbeat series query descriptor using the desired series sample, and then call the results(for:) method on the descriptor. // Create the descriptor. let heartbeatDescriptor = HKHeartbeatSeriesQueryDescriptor(myHeartbeatSample)

// Get the AsyncSequence that returns individual heartbeats. let series = heartbeatDescriptor.results(for: store)

// Access the data for each haeartbeat. for try await heartbeat in series {          // Process the results here.     print(heartbeat.precededByGap)     print(heartbeat.timeIntervalSinceStart) } While this method returns an AsyncSequence, unlike the long-running queries, this sequence has a finite size. Iterating over the sequence asynchronously returns heartbeat data, automatically terminating after you receive all the data.

## Topics

### Creating Heartbeat Series Query Descriptors

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

### Running Queries

- [results(for:)](healthkit/hkheartbeatseriesquerydescriptor/results(for:).md)
- [HKHeartbeatSeriesQueryDescriptor.Results](healthkit/hkheartbeatseriesquerydescriptor/results.md)
- [HKHeartbeatSeriesQueryDescriptor.Heartbeat](healthkit/hkheartbeatseriesquerydescriptor/heartbeat.md)

### Accessing Query Properties

- [sample](healthkit/hkheartbeatseriesquerydescriptor/sample.md)

### Default Implementations

- [HKAsyncSequenceQuery Implementations](healthkit/hkheartbeatseriesquerydescriptor/hkasyncsequencequery-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [HKAsyncSequenceQuery](healthkit/hkasyncsequencequery.md)

## See Also

### Series queries

- [HKQuantitySeriesSampleQueryDescriptor](healthkit/hkquantityseriessamplequerydescriptor.md)
- [HKQuantitySeriesSampleQuery](healthkit/hkquantityseriessamplequery.md)
- [HKWorkoutRouteQueryDescriptor](healthkit/hkworkoutroutequerydescriptor.md)
- [HKWorkoutRouteQuery](healthkit/hkworkoutroutequery.md)
- [HKHeartbeatSeriesQuery](healthkit/hkheartbeatseriesquery.md)
- [HKElectrocardiogramQueryDescriptor](healthkit/hkelectrocardiogramquerydescriptor.md)
- [HKElectrocardiogramQuery](healthkit/hkelectrocardiogramquery.md)
- [HKWorkoutEffortRelationship](healthkit/hkworkouteffortrelationship.md)
- [HKWorkoutEffortRelationshipQuery](healthkit/hkworkouteffortrelationshipquery.md)
