<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues:handler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(im)setWhiteBalanceModeLockedWithDeviceWhiteBalanceTemperatureAndTintValues:completionHandler:"
  },
  "title" : "setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues:handler:)"
}
-->

# setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues:handler:)

Sets white balance to locked mode with explicit temperature and tint values.

```
func setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues: AVCaptureDevice.WhiteBalanceTemperatureAndTintValues, handler: ((CMTime) -> Void)? = nil)
```

## Parameters

`whiteBalanceTemperatureAndTintValues`

The white balance temperature and tint values, as computed from [`temperatureAndTintValues(for:)`](/documentation/AVFoundation/AVCaptureDevice/temperatureAndTintValues(for:)) method, [`AVCaptureDevice.WhiteBalanceTemperatureAndTintValues`](/documentation/AVFoundation/AVCaptureDevice/WhiteBalanceTemperatureAndTintValues) presets or manual input.

`handler`

A block to be called when white balance values have been set to the values specified and [`whiteBalanceMode`](/documentation/AVFoundation/AVCaptureDevice/whiteBalanceMode-swift.property) is set to `AVCaptureWhiteBalanceModeLocked`. If [`setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues:handler:)`](/documentation/AVFoundation/AVCaptureDevice/setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues:handler:)) is called multiple times, the completion handlers are called in FIFO order. The block receives a timestamp which matches that of the first buffer to which all settings have been applied. Note that the timestamp is synchronized to the device clock, and thus must be converted to the [`synchronizationClock`](/documentation/AVFoundation/AVCaptureSession/synchronizationClock) prior to comparison with the timestamps of buffers delivered via an [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput). This parameter may be `nil` if synchronization is not required.

## Discussion

This method takes a [`AVCaptureDevice.WhiteBalanceTemperatureAndTintValues`](/documentation/AVFoundation/AVCaptureDevice/WhiteBalanceTemperatureAndTintValues) struct and applies the appropriate [`AVCaptureDevice.WhiteBalanceGains`](/documentation/AVFoundation/AVCaptureDevice/WhiteBalanceGains). This method throws an `NSRangeException` if any of the values are set to an unsupported level. This method throws an `NSGenericException` if called without first obtaining exclusive access to the device using [`lockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/lockForConfiguration()).

---

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)