Instance Method

addInput(_:)

Adds a given input to the session.

Declaration

func addInput(_ input: AVCaptureInput)

Parameters

input

An input to add to the session.

Discussion

You can only add an input to a session using this method if canAddInput(_:) returns true. This method throws an exception when invoked and canAddInput(_:) returns false.

You can invoke this method while the session is running.

See Also

Managing Inputs and Outputs

var inputs: [AVCaptureInput]

The capture session’s inputs.

func canAddInput(AVCaptureInput) -> Bool

Returns a Boolean value that indicates whether a given input can be added to the session.

func removeInput(AVCaptureInput)

Removes a given input.

var outputs: [AVCaptureOutput]

The capture session’s outputs.

func canAddOutput(AVCaptureOutput) -> Bool

Returns a Boolean value that indicates whether a given output can be added to the session.

func addOutput(AVCaptureOutput)

Adds a given output to the session.

func removeOutput(AVCaptureOutput)

Removes a given output.