Initializer

init(inputPort:videoPreviewLayer:)

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

Declaration

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

Parameters

port

An AVCaptureInput.Port object associated with an AVCaptureInput object.

layer

Return Value

A capture connection describing a connection between the port and layer.

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(inputPorts: [AVCaptureInput.Port], output: AVCaptureOutput)

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