Contents

preferredWorkoutZoneConfiguration(for:)

Returns a person’s preferred zone configuration for a quantity type.

Declaration

func preferredWorkoutZoneConfiguration(for quantityType: HKQuantityType) async throws -> HKWorkoutZoneConfiguration?

Parameters

  • quantityType:

    The quantity type for which to retrieve the preferred zone configuration.

Mentioned in

Return Value

The preferred zone configuration, or nil if the person hasn’t configured zones for the quantity type.

Discussion

The system returns the person’s manually configured zones from Health Settings, or the system-generated zones if the person hasn’t set custom values. System-generated zones update periodically as the person’s health metrics change, however, the system preserves zones that the person configures. Use this method to display zone information that aligns with the person’s preferences across their workouts.

This method throws an error if the framework can’t retrieve the requested zone configuration.

See Also

Accessing the preferred units