Initializer

init(inputPorts:output:)

Initializes a capture connection to describe a connection between the specified input ports and the specified output.

Declaration

init(inputPorts ports: [AVCaptureInput.Port], output: AVCaptureOutput)

Parameters

ports

An array of AVCaptureInput.Port objects associated with AVCaptureInput objects.

output

An AVCaptureOutput object.

Return Value

A capture connection initialized to describe a connection between inputPorts and the output.

Discussion

You can add the connection returned by this method to an AVCaptureSession instance using the addConnection(_:) method.

When using addInput(_:): or addOutput(_:), connections are automatically formed between all compatible inputs and outputs. You do not need to manually create and add connections to the session unless you use the primitive addInputWithNoConnections(_:) and addOutputWithNoConnections(_:) methods.

See Also

Creating a Connection

init(inputPort: AVCaptureInput.Port, videoPreviewLayer: AVCaptureVideoPreviewLayer)

Initializes a capture connection to describe a connection between the specified input port and the specified video preview layer.