Is there any priority condition between gesture methods (Pan Gesture and Swipe Gesture)?

NIKHIL picture NIKHIL · Feb 2, 2011 · Viewed 13.9k times · Source

I am developing an application where I have used the Pan Gesture as well as Swipe Gesture. So every time I do the Swipe Gesture but the method from the Pan Gesture is always getting called and Swipe Gesture method is not getting called.

Is there any priority between all the gesture method?

Answer

Atanas Chanev picture Atanas Chanev · Apr 14, 2012

You can call them in parallel by implementing the following method of the UIGestureRecognizerDelegate protocol:

- (BOOL)gestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer 
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UISwipeGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}