---
title: "setCustomZoneConfiguration(_:for:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkworkoutbuilder/setcustomzoneconfiguration(_:for:)"
---

# setCustomZoneConfiguration(_:for:)

Sets the zone configuration for the specified quantity type for this workout. In order to provide a custom workout zone configuration, this must be called before beginning collection on the builder. If a custom configuration is not provided, the user’s preferred workout zone configuration will be used for zone calculations.

## Declaration

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

## Parameters

- `configuration`: The zone configuration to use. Setting to nil will remove any custom configuration and use the preferred zone configuration for the quantity type.
- `quantityType`: The quantity type to apply the configuration to.

## Mentioned in

Accessing workout zone data

## Discussion

Discussion note: An error if the configuration cannot be set or is incompatible with the quantity type.

## See Also

### Configuring zone data

- [zoneConfiguration(for:)](healthkit/hkworkoutbuilder/zoneconfiguration(for:).md)
