How to allow clicking on focus on the camera using overlay

The standard iPhone 3GS camera includes focus focus (I can click on the area I want to focus on). However, when I use a custom overlay using the UIImagePickerController class, click to focus does not seem to work. Everything else in terms of image capture programmatically, etc. Btw works.

Please note that my overlay view is just a small rectangle (UIView) at the bottom of the screen. It does not cover other areas of the camera. Therefore, I believe that the cranes should pass (if I did not miss something). I have seen other applications use overlay and still provide click-to-focus functionality, so there should be a way to do this.

I use all the default controls that should be hidden as:

imagePicker.showsCameraControls = NO;
imagePicker.toolbarHidden = YES;
imagePicker.navigationBarHidden = YES;

Of course, the change above does not allow me to switch to focus (it just allows toolbars, etc.).

I could not find answers to the UIImagePickerController class link. Any help would be greatly appreciated. Thank!

+3
source share
1 answer

I just found out that the answer is pretty simple. Whether you see the square or not, when you touch the screen, it works. Give it a try. You just need to draw your square with animation.

+4
source

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


All Articles