Contents

autoFocusRangeRestriction

A value that controls the allowable range for automatic focusing.

Declaration

var autoFocusRangeRestriction: AVCaptureDevice.AutoFocusRangeRestriction { get set }

Discussion

By default, a device capable of hardware focusing attempts to focus on objects at any distance. If you expect to focus primarily on near or far objects, set a range restriction to increase the speed and reduce the power consumption of automatic focusing, and to reduce the chance of focusing ambiguities.

Before changing the value of this property, you must call lockForConfiguration() to acquire exclusive access to the device’s configuration properties. Otherwise, setting the value of this property raises an exception. When you finish configuring the device, call unlockForConfiguration() to release the lock and allow other devices to configure the settings.

See Also

Configuring automatic focus