Enumeration

UIImagePickerController.CameraFlashMode

The flash mode to use with the active camera.

Declaration

enum CameraFlashMode : Int

Overview

The constants in this enumeration are for use as values of the cameraFlashMode property.

The behavior of the flash depends on the camera capture mode.

For a given camera on a device, flash may or may not be available. You specify the active camera by way of the cameraDevice property. You can determine if the active camera has flash available by calling the isFlashAvailable(for:) class method.

You can manipulate the flash directly to provide effects such as a strobe light. Present a picker interface set to use video capture mode. Then, turn the flash LED on or off by setting the cameraFlashMode property to UIImagePickerController.CameraFlashMode.on or UIImagePickerController.CameraFlashMode.off.

Topics

Constants

case off

Specifies that flash illumination is always off, no matter what the ambient light conditions are.

case auto

Specifies that the device should consider ambient light conditions to automatically determine whether or not to use flash illumination.

case on

Specifies that flash illumination is always on, no matter what the ambient light conditions are.

See Also

Configuring the Flash Behavior

class func isFlashAvailable(for: UIImagePickerController.CameraDevice) -> Bool

Indicates whether a given camera has flash illumination capability.

var cameraFlashMode: UIImagePickerController.CameraFlashMode

The flash mode used by the active camera.