<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCapturePhotoSettings/flashMode",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCapturePhotoSettings(py)flashMode"
  },
  "title" : "flashMode"
}
-->

# flashMode

A setting for whether to fire the flash when capturing photos.

```
var flashMode: AVCaptureDevice.FlashMode { get set }
```

## Discussion

The default value for this setting is [`AVCaptureDevice.FlashMode.off`](/documentation/AVFoundation/AVCaptureDevice/FlashMode-swift.enum/off).

> Note:
> This setting supersedes the deprecated ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice`` ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/flashMode-swift.property`` property. When using the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoOutput`` class, the capture device’s flash mode doesn’t apply—use this property on your photo settings object instead.

Assuming a static scene, using the [`AVCaptureDevice.FlashMode.auto`](/documentation/AVFoundation/AVCaptureDevice/FlashMode-swift.enum/auto) setting is equivalent to testing the [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) [`isFlashScene`](/documentation/AVFoundation/AVCapturePhotoOutput/isFlashScene) property (which indicates whether flash is recommended for the scene currently visible to the camera), and then setting the [`flashMode`](/documentation/AVFoundation/AVCapturePhotoSettings/flashMode) property of your photo settings output accordingly before requesting a capture. However, the visible scene can change between when you request a capture and when the camera hardware captures an image—the automatic setting ensures that the flash is enabled or disabled appropriately at the moment of capture. When the capture occurs, your [`AVCapturePhotoCaptureDelegate`](/documentation/AVFoundation/AVCapturePhotoCaptureDelegate) methods receive an [`AVCaptureResolvedPhotoSettings`](/documentation/AVFoundation/AVCaptureResolvedPhotoSettings) object whose [`isFlashEnabled`](/documentation/AVFoundation/AVCaptureResolvedPhotoSettings/isFlashEnabled) property indicates which flash mode was used for that capture.

> Note:
> When the device becomes very hot, the flash becomes temporarily unavailable until the device cools down (see the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice`` ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/isFlashAvailable`` property). While the flash is unavailable, a photo output’s ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoOutput/supportedFlashModes-4u69s`` property still reports the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/FlashMode-swift.enum/on`` and ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureDevice/FlashMode-swift.enum/auto`` options as available, so you can still enable the flash in your photo settings even when the flash is temporarily unavailable.
> 
> When the photo output calls your ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoCaptureDelegate`` methods, check the ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureResolvedPhotoSettings/isFlashEnabled`` property of the provided ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureResolvedPhotoSettings`` to verify whether the flash is in use.

When specifying a flash mode, the following requirements apply:

- The specified mode must be present in the photo output’s [`supportedFlashModes`](/documentation/AVFoundation/AVCapturePhotoOutput/supportedFlashModes-4u69s) array.
- You may not enable image stabilization if the flash mode is [`AVCaptureDevice.FlashMode.on`](/documentation/AVFoundation/AVCaptureDevice/FlashMode-swift.enum/on). (Enabling the flash takes priority over the [`isAutoStillImageStabilizationEnabled`](/documentation/AVFoundation/AVCapturePhotoSettings/isAutoStillImageStabilizationEnabled) setting).

The capture output validates these requirements when you call the [`capturePhoto(with:delegate:)`](/documentation/AVFoundation/AVCapturePhotoOutput/capturePhoto(with:delegate:)) method. If your settings don’t meet these requirements, that method raises an exception.

---

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)