init(quantityType:zoneBoundaries:)
Initializes a zone configuration from zone boundaries for the specified quantity type.
Declaration
init(quantityType: HKQuantityType, zoneBoundaries: [HKQuantity]) throwsParameters
- quantityType:
The quantity type to which these zones apply.
- zoneBoundaries:
An array of quantities that represent the upper boundaries of each zone, ordered from lowest to highest. The first zone has no lower bound, and the last zone has no upper bound.
Return Value
A zone configuration with source set to .app.
Discussion
The system creates the individual zones based on the boundaries you provide. This method ensures that zones are contiguous and nonoverlapping. Call this method before calling setCustomZoneConfiguration(_:for:) to apply custom zones to a workout.