Question

I am using cocos 2d and I wanted to track multiple independent pan gestures. But I don't know how to do this neither by using onTouchBegin nor UIPanGesture class. If you could help me, I'd be grateful.

I've multiple sprites in the screen. I want the user to be able to drag them independently and concurrently.

Was it helpful?

Solution

In the gesture delegates for both of your recognizers, implement the following protocol method:

-(BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer
{
    return YES;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top