Constants identifying the reason a capture session was interrupted, found in an AVCaptureSessionWasInterrupted user info dictionary.


enum InterruptionReason : Int



case videoDeviceNotAvailableInBackground

An interruption caused by the app being sent to the background while using a camera.

case audioDeviceInUseByAnotherClient

An interruption caused by the audio hardware temporarily being made unavailable (for example, for a phone call or alarm).

case videoDeviceInUseByAnotherClient

An interruption caused by the video device temporarily being made unavailable (for example, when used by another capture session).

case videoDeviceNotAvailableWithMultipleForegroundApps

An interruption caused when your app is running in Slide Over, Split View, or Picture in Picture mode on iPad.

case videoDeviceNotAvailableDueToSystemPressure

An interruption due to system pressure, such as thermal duress.

See Also

Managing Running State

func startRunning()

Tells the receiver to start running.

func stopRunning()

Tells the receiver to stop running.

var isRunning: Bool

Indicates whether the receiver is running.

var isInterrupted: Bool

Indicates whether the receiver has been interrupted.

static let AVCaptureSessionRuntimeError: NSNotification.Name

Posted if an error occurred during a capture session.

static let AVCaptureSessionWasInterrupted: NSNotification.Name

Posted if a capture session is interrupted.

static let AVCaptureSessionInterruptionEnded: NSNotification.Name

Posted if an interruption to a capture session finishes.

let AVCaptureSessionErrorKey: String

Key to retrieve the error object from a AVCaptureSessionRuntimeError user info dictionary.

let AVCaptureSessionInterruptionReasonKey: String

Key to retrieve information about a capture interruption from a AVCaptureSessionWasInterrupted user info dictionary.

let AVCaptureSessionInterruptionSystemPressureStateKey: String

The key for retrieving information about system pressure factors that caused a capture session interruption.