Instance Property


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


var intervalComponents: DateComponents { get }


This property defines the length of the time intervals for your collection. The following code sample shows a number of common time intervals.

let fiveMinutes = NSDateComponents()
fiveMinutes.minute = 5
let hour = NSDateComponents()
hour.hour = 1
let day = NSDateComponents() = 1
let week = NSDateComponents() = 7
let month = NSDateComponents()
month.month = 1
let year = NSDateComponents()
year.year = 1

See Also

Getting Property Data

var anchorDate: Date

The anchor date for the collection’s time intervals.

var options: HKStatisticsOptions

A list of options that define the type of statistical calculations performed and the way in which data from multiple sources are merged.