init(inputPort:videoPreviewLayer:)
Creates a capture connection that represents a connection between an input port and a video preview layer.
Declaration
init(inputPort port: AVCaptureInput.Port, videoPreviewLayer layer: AVCaptureVideoPreviewLayer)Parameters
- port:
An Port instance that relates to an Avcaptureinput instance.
- layer:
An Avcapturevideopreviewlayer instance.
Return Value
A capture connection that represents a connection between port and layer.
Discussion
You can add the connection this method returns to an AVCaptureSession instance with the addConnection(_:) method.
The addInput(_:): or addOutput(_:) methods automatically form connections between all compatible inputs and outputs. You don’t need to manually create and add connections to the session unless you use the primitive addInputWithNoConnections(_:) and addOutputWithNoConnections(_:) methods.