WorkoutKit: Alert - HeartRateZoneAlert vs PowerZoneAlert

Hello, I'm trying to understand what's the difference between:

  • HeartRateZoneAlert: static func heartRate(zone: Int) -> Self
  • PowerZoneAlert : static func power(zone: Int) -> Self

And also, why HeartRate alerts support range, but Power doesn't support Range?

There is a difference between power and a Heartrate. Your power is for example the watts you produce when your are cycling. You can also set a zone for a power zone:

let powerMinValue = HKQuantity(unit .watt(), doubleValue: 250)
let powerMaxValue = HKQuantity(unit .watt(), doubleValue: 270)
let powerRange: WorkoutTargetType = .range(min: powerMinValue, max: powerMaxValue)
let powerAlert = WorkoutAlert(type: .currentPower, target: powerRange)

This can be seen on on this WWDC video

WorkoutKit: Alert - HeartRateZoneAlert vs PowerZoneAlert
 
 
Q