<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/setExposureModeCustom(duration:iso:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(im)setExposureModeCustomWithDuration:ISO:completionHandler:"
  },
  "title" : "setExposureModeCustom(duration:iso:completionHandler:)"
}
-->

# setExposureModeCustom(duration:iso:completionHandler:)

Sets the exposure mode to a custom state, and locks exposure duration and ISO at explicit values.

```
func setExposureModeCustom(duration: CMTime, iso ISO: Float, completionHandler handler: (@Sendable (CMTime) -> Void)? = nil)
```

## Parameters

`duration`

The exposure duration.

    Pass a value of [`currentExposureDuration`](/documentation/AVFoundation/AVCaptureDevice/currentExposureDuration)     to leave the current exposure duration unchanged.

    Changes made to the exposure duration may result in changes to [`activeVideoMinFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/activeVideoMinFrameDuration)     or [`activeVideoMaxFrameDuration`](/documentation/AVFoundation/AVCaptureDevice/activeVideoMaxFrameDuration)    .

`ISO`

The exposure ISO value.

    Pass a value of [`currentISO`](/documentation/AVFoundation/AVCaptureDevice/currentISO)     to leave the current ISO unchanged.

`handler`

A callback the system invokes when the adjustment to the exposure duration and ISO is complete. If you call this method multiple times, the system calls the completion handlers in FIFO order.

    The system passes a time value that matches that of the first buffer to which its applied all settings. It synchronizes the timestamp to the device clock, and you must convert the timestamp to the [`synchronizationClock`](/documentation/AVFoundation/AVCaptureSession/synchronizationClock)     prior to comparison with the timestamps of buffers delivered through an [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput)    .

    You can pass     `nil`     for this parameter if you don’t require this information.

## Discussion

This method throws an exception if you set the exposure duration or ISO values to an unsupported level

Before changing exposure mode, you must call [`lockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/lockForConfiguration()) to acquire exclusive access to the device’s configuration properties. Otherwise, setting the value of this property raises an exception. When you finish configuring the device, call [`unlockForConfiguration()`](/documentation/AVFoundation/AVCaptureDevice/unlockForConfiguration()) to release the lock and allow other devices to configure the settings.

When using [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) to capture photos, the [`photoQualityPrioritization`](/documentation/AVFoundation/AVCapturePhotoSettings/photoQualityPrioritization) property of [`AVCapturePhotoSettings`](/documentation/AVFoundation/AVCapturePhotoSettings) defaults to [`AVCapturePhotoOutput.QualityPrioritization.balanced`](/documentation/AVFoundation/AVCapturePhotoOutput/QualityPrioritization/balanced), which allows photo capture to temporarily override the capture device’s exposure duration and ISO if the scene is dark enough to require multi-image fusion to improve quality. To ensure that the system honors the device exposure duration and ISO values while in [`AVCaptureDevice.ExposureMode.custom`](/documentation/AVFoundation/AVCaptureDevice/ExposureMode-swift.enum/custom) or [`AVCaptureDevice.ExposureMode.locked`](/documentation/AVFoundation/AVCaptureDevice/ExposureMode-swift.enum/locked) mode, you must photo quality prioritization to [`AVCapturePhotoOutput.QualityPrioritization.speed`](/documentation/AVFoundation/AVCapturePhotoOutput/QualityPrioritization/speed).

## Topics

### Exposure constants

[`currentExposureDuration`](/documentation/AVFoundation/AVCaptureDevice/currentExposureDuration)

A special constant representing the current exposure duration setting.

[`currentISO`](/documentation/AVFoundation/AVCaptureDevice/currentISO)

A constant to indicate not to specify a new ISO value, and instead set it to its current value.



---

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)