How to find out if the device supports autofocus

I would like to know if there is a way to check if the deviceโ€™s camera supports autofocus?

The only solution I found was to check the device name to see if it supports autofocus or not. But I did not like it, because it did not work for the future device.

+4
source share
1 answer

Using the new AVFoundation APIs in iOS 4.0, you can verify this by requesting an instance of AVCaptureDevice for the camera using your -isFocusModeSupported: method. Focus modes include AVCaptureFocusModeLocked , AVCaptureFocusModeAutoFocus and AVCaptureFocusModeContinuousAutoFocus .

+8
source

Source: https://habr.com/ru/post/1314382/


All Articles