Instance Method


Adds a given capture connection to the session.


func addConnection(_ connection: AVCaptureConnection)



The capture connection to add to the session.


You can only add an AVCaptureConnection instance to a session using this method if canAddConnection(_:) returns true.

When using addInput(_:) or addOutput(_:), connections are formed automatically between all compatible inputs and outputs. Manually adding connections is only necessary when adding an input or output with no connections.

See Also

Managing Connections

var connections: [AVCaptureConnection]

An array of connections managed by the capture session.

func canAddConnection(AVCaptureConnection) -> Bool

Returns a Boolean value that indicates whether a given connection can be added to the receiver.

func addInputWithNoConnections(AVCaptureInput)

Adds a capture input to the session without forming any connections.

func addOutputWithNoConnections(AVCaptureOutput)

Adds a capture output to the session without forming any connections.

func removeConnection(AVCaptureConnection)

Removes a capture connection from the session.