Continuous autofocus not working on iPhone 14?

I have an app, which has been in production for about 8 years, which uses a live camera view for the purpose of capturing barcodes. The app configures the camera for continuous autofocus with this code:

if ([videoDevice isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus]) {

            videoDevice.focusMode = AVCaptureFocusModeContinuousAutoFocus;

		}

This has worked fine for years, but a customer who just upgraded to an iPhone 14 says that it doesn't work on his phone; the image never focuses and the barcode cannot be read.

Has something changed recently, either in iOS or with the iPhone 14, that would render this code incorrect? Xcode does not flag it with any warnings.

Thanks, Frank

Answered by DTS Engineer in 736314022

Hello,

Most likely the issue you are seeing is related to the fact that the wide angle camera's minimumFocusDistance of iPhone 14 Pro is further than previous iPhones. It's not that continuous autofocus isn't working, but rather the wide angle camera is unable to focus at this closer distance.

To resolve this, you should utilize one of the virtual cameras either the builtInDualWideCamera, or the builtInTripleCamera. These virtual cameras will (by default) automatically switch over to the ultra-wide angle camera when possible, to maintain focus of the subject.

Accepted Answer

Hello,

Most likely the issue you are seeing is related to the fact that the wide angle camera's minimumFocusDistance of iPhone 14 Pro is further than previous iPhones. It's not that continuous autofocus isn't working, but rather the wide angle camera is unable to focus at this closer distance.

To resolve this, you should utilize one of the virtual cameras either the builtInDualWideCamera, or the builtInTripleCamera. These virtual cameras will (by default) automatically switch over to the ultra-wide angle camera when possible, to maintain focus of the subject.

Hi I tried this (using builtInDualWideCamera, or the builtInTripleCamera) but its not auto switch the camera. when im using the camera app of apple its does switch the camera. how can i do it in my app? @gchiste

Continuous autofocus not working on iPhone 14?
 
 
Q