Camera focus square for iPhone iOS 4.3 - is it removed programmatically?

Since my friend upgraded his iPhone iOS to 4.3, a small square has appeared that appears every time he takes a picture with the camera. We are developing an application that uses a camera and would like to remove this annoying square. I did not find anything about this in the Apple UIImagePickerController documentation. The square did not exist in previous versions of iOS.

+2
source share
3 answers

You can try to lock focus to turn off autofocus. Here is a sample code:

NSArray *devices = [AVCaptureDevice devices]; NSError *error; for (AVCaptureDevice *device in devices) { if (([device hasMediaType:AVMediaTypeVideo]) && ([device position] == AVCaptureDevicePositionBack) ) { [device lockForConfiguration:&error]; if ([device isFocusModeSupported:AVCaptureFocusModeLocked]) { device.focusMode = AVCaptureFocusModeLocked; NSLog(@"Focus locked"); } [device unlockForConfiguration]; } } 
+4
source

Setting the .showsCameraControls property of your selection controller to NO should remove the focus square (this was done before 4.3, I don’t think something has changed), but the disadvantage is that you will need to provide your own (for photographing, etc. .). Is that all or nothing I'm afraid of!

+2
source

Custom overlay and overlay creation are not displayed by default. You can make your overlay completely empty.

0
source

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


All Articles