Instance Property

flashMode

The current flash mode.

Declaration

var flashMode: AVCaptureDevice.FlashMode { get set }

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 are done configuring the device, call unlockForConfiguration() to release the lock and allow other devices to configure the settings.

You can observe changes to the value of this property using Key-value observing.

See AVCaptureDevice.FlashMode for possible values.

See Also

Managing Flash Settings

var hasFlash: Bool

Indicates whether the capture device has a flash.

func isFlashModeSupported(AVCaptureDevice.FlashMode) -> Bool

Returns a Boolean value that indicates whether the given flash mode is supported.

var isFlashActive: Bool

Indicates whether the flash is currently active.

Deprecated
var isFlashAvailable: Bool

Indicates whether the flash is currently available for use.

enum AVCaptureDevice.FlashMode

Constants to specify the flash mode of a capture device.