Instance Method


Locks the lens position at the specified value.


- (void)setFocusModeLockedWithLensPosition:(float)lensPosition completionHandler:(void (^)(CMTime syncTime))handler;



The lens position. A value of AVCaptureLensPositionCurrent can be used to indicate that the caller does not wish to specify a value for lensPosition.


A block that is called when lensPosition has been set to the value specified and focusMode is AVCaptureFocusModeLocked. The block receives a timestamp matching that of the first buffer to which all settings have been applied.

The timestamp is synchronized to the device clock, and thus must be converted to the master clock before comparison with the timestamps of buffers delivered by AVCaptureVideoDataOutput instance.

The client may pass nil for the handler parameter if knowledge of the operation's completion is not required.


This method is the only way to set the lensPosition property.

This method throws an NSInvalidArgumentException exception if lensPosition is set to an unsupported level. A NSGenericException exception is thrown if the method is called without first obtaining exclusive access to the receiver using lockForConfiguration:.

See Also

Managing the Lens Position


Indicates the focus position of the lens.


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


A special constant representing the current lens position.

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