One Logo Pool Ball
HealthKit · IOS API REFERENCE

HKStatisticsCollectionQueryDescriptor

struct · iOS 15.4+ · SDK 27.1

struct HKStatisticsCollectionQueryDescriptor

Members (11)

get · iOS 15.4+

anchorDate

TypeScript
get anchorDate(): globalThis.Date
Swift declaration
var anchorDate: Date

The anchor date for the resulting collection’s time intervals.

set · iOS 15.4+

anchorDate

TypeScript
set anchorDate(value: globalThis.Date)
Swift declaration
var anchorDate: Date

The anchor date for the resulting collection’s time intervals.

get · iOS 15.4+

intervalComponents

TypeScript
get intervalComponents(): _Foundation_DateComponents
Swift declaration
var intervalComponents: DateComponents

The date components that define the time interval for each statistics object in the resulting collection.

set · iOS 15.4+

intervalComponents

TypeScript
set intervalComponents(value: _Foundation_DateComponents)
Swift declaration
var intervalComponents: DateComponents

The date components that define the time interval for each statistics object in the resulting collection.

method · iOS 15.4+

result

TypeScript
result(healthStore: HKHealthStore): Promise<HKStatisticsCollection>
Swift declaration
func result(for healthStore: HKHealthStore) async throws -> HKStatisticsCollection

Returns the collection of statistics matching the receiver.

get · iOS 15.4+

options

TypeScript
get options(): HKStatisticsOptions
Swift declaration
var options: HKStatisticsOptions

The options indicating which types of statistics to compute.

set · iOS 15.4+

options

TypeScript
set options(value: HKStatisticsOptions)
Swift declaration
var options: HKStatisticsOptions

The options indicating which types of statistics to compute.

method · iOS 15.4+

results

TypeScript
results(healthStore: HKHealthStore): HKStatisticsCollectionQueryDescriptor_Results
Swift declaration
func results(for healthStore: HKHealthStore) -> HKStatisticsCollectionQueryDescriptor.Results

Returns an `AsyncSequence` representing a stream of changes to the statistics collection matching the receiver. The first element will reflect the current state of the statistics collection. Subsequent elements will be yielded to reflect changes to the collection. When possible, the `updateStatistics` property will be populated to indicate the specific statistics that have changed.

init · iOS 15.4+

init

TypeScript
static init(predicate: HKSamplePredicate<HKQuantitySample>, options: HKStatisticsOptions, anchorDate: globalThis.Date, intervalComponents: _Foundation_DateComponents): HKStatisticsCollectionQueryDescriptor
Swift declaration
init(predicate: HKSamplePredicate<HKQuantitySample>, options: HKStatisticsOptions, anchorDate: Date, intervalComponents: DateComponents)
get · iOS 15.4+

predicate

TypeScript
get predicate(): HKSamplePredicate<HKQuantitySample>
Swift declaration
var predicate: HKSamplePredicate<HKQuantitySample>

The predicate matching the samples to compute statistics over.

set · iOS 15.4+

predicate

TypeScript
set predicate(value: HKSamplePredicate<HKQuantitySample>)
Swift declaration
var predicate: HKSamplePredicate<HKQuantitySample>

The predicate matching the samples to compute statistics over.

Skipped declarations

No declarations were skipped in this snapshot.

All HealthKit types →