Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 680
NIKHIL Avatar asked Feb 02 '11 13:02

NIKHIL


People also ask

What is a pan gesture?

A pan gesture occurs any time a person moves one or more fingers around the screen. A screen-edge pan gesture is a specialized pan gesture that originates from the edge of the screen. Use the UIPanGestureRecognizer class for pan gestures and the UIScreenEdgePanGestureRecognizer class for screen-edge pan gestures.


1 Answers

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

- (BOOL)gestureRecognizer:(UIPanGestureRecognizer *)gestureRecognizer 
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UISwipeGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}
like image 137
Atanas Chanev Avatar answered Oct 14 '22 21:10

Atanas Chanev