Instance Property


Indicates the focus position of the lens.


var lensPosition: Float { get }


A given lens position value does not correspond to an exact physical distance, nor does it represent a consistent focus distance from device to device.

The range of possible positions is 0.0 to 1.0, with 0.0 being the shortest distance at which the lens can focus and 1.0 the furthest. Note that 1.0 does not represent focus at infinity. The default value is 1.0.

The value can be read at any time, regardless of focus mode, but can only be set via setFocusModeLocked(lensPosition:completionHandler:).

You can observe changes to the value of this property using Key-value observing.

See Also

Managing the Lens Position

var isLockingFocusWithCustomLensPositionSupported: Bool

A Boolean value indicating whether the device supports locking focus to a specific lens position.

class let currentLensPosition: Float

This value may be passed as the lensPosition parameter of setFocusModeLocked(lensPosition:completionHandler:) to indicate that no value should be set for the lensPosition property, and that it should instead be set to its current value.