Feeds:
Posts
Comments

There are several apps on the app store that use the camera with a custom overlay, but also support default touch-to-focus behavior on a iPhone 3GS.  This doesn’t seem supported directly through the APIs, but the PLPreviewView subview is the view that needs to get the touch events in order to continue supporting the tap-to-focus behavior. By default, once you add a overlay to the UIImagePickerController, the overlay gets all the touches and doesn’t pass the touches on to the PLPreviewView. In order to get around this behavior, we have to get the PLPreviewView subview and manually pass on the touchesBegan events.

I am not sure if you will have trouble getting this through the app store, so try at your own risk.

Create a custom UIView that has access a @property for the UIImagePickerController named picker.

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    UIView * previewView = [[[[[[[[[[
                                     self.picker.view // UILayoutContainerView
                                 subviews] objectAtIndex:0] // UINavigationTransitionView
                             subviews] objectAtIndex:0] // UIViewControllerWrapperView
                         subviews] objectAtIndex:0] // UIView
                     subviews] objectAtIndex:0] // PLCameraView
                 subviews] objectAtIndex:0]; // PLPreviewView
    [previewView touchesBegan:touches withEvent:event];
}