Instance Method

lockForConfiguration()

Requests exclusive access to the device’s hardware properties.

Declaration

func lockForConfiguration() throws

Parameters

None

This method throws an error in cases of failure.

Return Value

This method throws an error in cases of failure.

Discussion

Call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling.

You must call this method before attempting to configure the hardware related properties of the device. You may hold onto a lock (instead of releasing it) if you require the device properties to remain unchanged. However, holding the device lock unnecessarily may degrade capture quality in other apps sharing the device.

See Also

Configuring the Device

func unlockForConfiguration()

Relinquishes exclusive control over the device’s configuration.

var isInUseByAnotherApplication: Bool

Indicates whether the device is being used exclusively by another application.

var isSuspended: Bool

Indicates whether the device is suspended.

var linkedDevices: [AVCaptureDevice]

An array of AVCaptureDevice objects representing the devices physically linked to the receiver.

var transportType: Int32

The transport type of the receiver.

class AVCaptureDevice.InputSource

A distinct input source on a capture device.

var inputSources: [AVCaptureDevice.InputSource]

An array of AVCaptureDevice.InputSource objects representing the input sources supported by the device.

var activeInputSource: AVCaptureDevice.InputSource?

The currently active input source.

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