Instance Property

connection

The capture connection describing the AVCaptureInputPort to which the preview layer is connected.

Declaration

var connection: AVCaptureConnection? { get }

Discussion

When you associate a preview layer with a capture session, the capture session implicitly forms a connection to the first eligible video AVCaptureInput.Port object. If you detach a preview layer from a session, the connection property becomes nil.

See Also

Session Configuration

var session: AVCaptureSession?

The previewed capture session.

func setSessionWithNoConnection(AVCaptureSession)

Attaches the layer to a given session without implicitly forming a connection.