From 8c254364ced28c50ae1f57b67e1df44b55e51ee8 Mon Sep 17 00:00:00 2001 From: Sam Spencer Date: Fri, 31 Jul 2015 14:10:23 -0400 Subject: [PATCH] Allow Gesture Recognizer To Function Simultaneously With Other GRs This modification ensures that apps depending upon this library which have other gesture recognizers in use during the display of BEMSimpleLineGraphView will be able to utilize delegate methods -lineGraph:didTouchGraphWithClosestIndex: and -lineGraph:didReleaseTouchFromGraphWithClosestIndex: Without responding to the UIGestureRecognizer delegate method changes contained in this commit, the BEMSimpleLineGraphView delegate methods are never called. --- Classes/BEMSimpleLineGraphView.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/BEMSimpleLineGraphView.m b/Classes/BEMSimpleLineGraphView.m index 9931d2a..a0f02c2 100644 --- a/Classes/BEMSimpleLineGraphView.m +++ b/Classes/BEMSimpleLineGraphView.m @@ -1301,6 +1301,14 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { } else return NO; } +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{ + return YES; +} +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ + return YES; +} + + - (void)handleGestureAction:(UIGestureRecognizer *)recognizer { CGPoint translation = [recognizer locationInView:self.viewForBaselineLayout];