diff --git a/LLSimpleCamera/LLSimpleCamera.h b/LLSimpleCamera/LLSimpleCamera.h index 4e9f9f5..0a02102 100644 --- a/LLSimpleCamera/LLSimpleCamera.h +++ b/LLSimpleCamera/LLSimpleCamera.h @@ -215,6 +215,11 @@ typedef enum : NSUInteger { */ - (void)alterFocusBox:(CALayer *)layer animation:(CAAnimation *)animation; +/** + * Call this method in case you need to implement a custom tap to focus gesture + */ +- (void) focusViewWithGesture: (UITapGestureRecognizer *) gesture; + /** * Checks is the front camera is available. */ diff --git a/LLSimpleCamera/LLSimpleCamera.m b/LLSimpleCamera/LLSimpleCamera.m index db75c9f..b8956c2 100644 --- a/LLSimpleCamera/LLSimpleCamera.m +++ b/LLSimpleCamera/LLSimpleCamera.m @@ -749,6 +749,14 @@ - (void)showFocusBox:(CGPoint)point } } +- (void) focusViewWithGesture: (UITapGestureRecognizer *) gesture { + CGPoint touchedPoint = [gesture locationInView:self.view]; + + if (CGRectContainsPoint(self.view.frame, touchedPoint)) { + [self previewTapped:gesture]; + } +} + #pragma mark - UIViewController - (void)viewWillAppear:(BOOL)animated