Initializer

init(device:)

Initializes an input to use a specified device.

Declaration

init(device: AVCaptureDevice) throws

Parameters

device

The device from which to capture input.

outError

If an error occurs during initialization, upon return contains an NSError object describing the problem.

Return Value

An input initialized to use device.

Discussion

In Swift, this API is imported as an initializer and is marked with the throws keyword to indicate that it throws an error in cases of failure.

You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in The Swift Programming Language (Swift 4.1) and About Imported Cocoa Error Parameters.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software