Instance Method

setFocusModeLockedWithLensPosition:completionHandler:

Locks the lens position at the specified value.

Declaration

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

Parameters

lensPosition

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

handler

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.

Discussion

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

lensPosition

Indicates the focus position of the lens.

lockingFocusWithCustomLensPositionSupported

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

AVCaptureLensPositionCurrent

A special constant representing the current lens position.