Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know if device supports auto-focus

Tags:

ios

iphone

I would like to know if it exists a way to check if device camera supports auto-focus ?

The only solution I found is to check device name in order to know if it supports auto-focus or not. But I did not like it because it did not work for future device.

like image 960
Quentin Avatar asked Feb 26 '23 17:02

Quentin


1 Answers

Using the new AVFoundation APIs in iOS 4.0, you can check this by querying the AVCaptureDevice instance for the camera using its -isFocusModeSupported: method. The focus modes include AVCaptureFocusModeLocked, AVCaptureFocusModeAutoFocus, and AVCaptureFocusModeContinuousAutoFocus.

like image 197
Brad Larson Avatar answered Mar 11 '23 03:03

Brad Larson