<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutBuilder/setCustomZoneConfiguration(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "s:So16HKWorkoutBuilderC9HealthKitE26setCustomZoneConfiguration_3foryAC0agH0VSg_So14HKQuantityTypeCtYaKF"
  },
  "title" : "setCustomZoneConfiguration(_:for:)"
}
-->

# setCustomZoneConfiguration(_:for:)

Overrides the preferred zone configuration with a custom zone for the current workout.

```
func setCustomZoneConfiguration(_ configuration: HKWorkoutZoneConfiguration?, for quantityType: HKQuantityType) async throws
```

## Parameters

`configuration`

The zone configuration to use, or `nil` to remove any custom configuration and use the person’s preferred zones.

`quantityType`

The quantity type to which to apply the configuration.

## Discussion

Call this method before calling [`beginCollection(withStart:completion:)`](/documentation/HealthKit/HKWorkoutBuilder/beginCollection(withStart:completion:)) to apply custom zones. If you don’t set a custom configuration, the system uses the person’s preferred zone configuration from Health Settings for zone calculations. Custom configurations apply only to this workout and don’t modify the person’s preferred zones.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)