Skip to content

Commit

Permalink
Add cancelling-other-gesture logic for iOS6.
Browse files Browse the repository at this point in the history
  • Loading branch information
inamiy committed Mar 17, 2013
1 parent 8d882e2 commit 50ee8bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions YIEdgePanGestureRecognizer/YIEdgePanGestureRecognizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ - (BOOL)canPreventGestureRecognizer:(UIGestureRecognizer *)preventedGestureRecog
- (BOOL)canBePreventedByGestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer
{
if (!CGPointEqualToPoint(_firstTouchLocation, CGPointZero)) {

//
// Force-cancel other gestures (e.g. scrolling) for iOS6
//
// NOTE:
// iOS5 calls canPreventGestureRecognizer when other gesture is active but not for iOS6,
// so we implement cancelling logic on canBePreventedByGestureRecognizer here.
//
BOOL enabled = preventingGestureRecognizer.enabled;
preventingGestureRecognizer.enabled = NO;
preventingGestureRecognizer.enabled = enabled;

return NO;
}
else {
Expand Down

0 comments on commit 50ee8bd

Please sign in to comment.