---
title: flashMode
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcapturedevice/flashmode-swift.property
---

# flashMode

The device’s current flash mode.

## Declaration

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

## Discussion

Discussion Before changing the value of this property, you must call 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() to release the lock and allow other devices to configure the settings. This property is key-value observable.

## See Also

### Configuring flash settings

- [hasFlash](avfoundation/avcapturedevice/hasflash.md)
- [isFlashAvailable](avfoundation/avcapturedevice/isflashavailable.md)
- [isFlashActive](avfoundation/avcapturedevice/isflashactive.md)
- [isFlashModeSupported(_:)](avfoundation/avcapturedevice/isflashmodesupported(_:).md)
- [AVCaptureDevice.FlashMode](avfoundation/avcapturedevice/flashmode-swift.enum.md)
