---
title: flashMode
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcapturephotosettings/flashmode
---

# flashMode

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

## Declaration

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

## Discussion

Discussion The default value for this setting is AVCaptureDevice.FlashMode.off. note: This setting supersedes the deprecated AVCaptureDevice flashMode property. When using the 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 setting is equivalent to testing the AVCapturePhotoOutput isFlashScene property (which indicates whether flash is recommended for the scene currently visible to the camera), and then setting the 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 methods receive an AVCaptureResolvedPhotoSettings object whose 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 AVCaptureDevice isFlashAvailable property). While the flash is unavailable, a photo output’s supportedFlashModes property still reports the AVCaptureDevice.FlashMode.on and AVCaptureDevice.FlashMode.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 AVCapturePhotoCaptureDelegate methods, check the isFlashEnabled property of the provided 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 array. You may not enable image stabilization if the flash mode is AVCaptureDevice.FlashMode.on. (Enabling the flash takes priority over the isAutoStillImageStabilizationEnabled setting). The capture output validates these requirements when you call the capturePhoto(with:delegate:) method. If your settings don’t meet these requirements, that method raises an exception.

## See Also

### Configuring photo settings

- [isAutoRedEyeReductionEnabled](avfoundation/avcapturephotosettings/isautoredeyereductionenabled.md)
- [maxPhotoDimensions](avfoundation/avcapturephotosettings/maxphotodimensions.md)
- [photoQualityPrioritization](avfoundation/avcapturephotosettings/photoqualityprioritization.md)
- [isCameraCalibrationDataDeliveryEnabled](avfoundation/avcapturephotosettings/iscameracalibrationdatadeliveryenabled.md)
- [isAutoContentAwareDistortionCorrectionEnabled](avfoundation/avcapturephotosettings/isautocontentawaredistortioncorrectionenabled.md)
- [isAutoVirtualDeviceFusionEnabled](avfoundation/avcapturephotosettings/isautovirtualdevicefusionenabled.md)
- [virtualDeviceConstituentPhotoDeliveryEnabledDevices](avfoundation/avcapturephotosettings/virtualdeviceconstituentphotodeliveryenableddevices.md)
- [isDualCameraDualPhotoDeliveryEnabled](avfoundation/avcapturephotosettings/isdualcameradualphotodeliveryenabled.md)
- [isAutoDualCameraFusionEnabled](avfoundation/avcapturephotosettings/isautodualcamerafusionenabled.md)
- [isAutoStillImageStabilizationEnabled](avfoundation/avcapturephotosettings/isautostillimagestabilizationenabled.md)
- [isHighResolutionPhotoEnabled](avfoundation/avcapturephotosettings/ishighresolutionphotoenabled.md)
