How to use UILongPressGestureRecognizer with sprite drag & wait?

Posted by ganesh on Game Development See other posts from Game Development or by ganesh
Published on 2013-07-22T01:20:34Z Indexed on 2013/10/21 4:12 UTC
Read the original article Hit count: 369

Filed under:
|
|

May be it's asked before also but I couldn't find any good answer.

Please tell me how this can be implemented with UILongPressGestureRecognizer?

A user drags a sprite from X location to Y location. Then it waits at Y location (touch is not ended yet) for 1 or 2 secs and release the touch i.e touch is ended. In this case, shouldn't following states be triggered in below order for UILongPressGestureRecognizer:

  1. UIGestureRecognizerStateBegan
  2. UIGestureRecognizerStateChanged
  3. UIGestureRecognizerStateEnded

? My problem is if UIPanGestureRecognizer is also implemented to handle drags, UILongPressGesture is never triggered even after Long waits.

Any thoughts?

© Game Development or respective owner

Related posts about cocos2d-iphone

Related posts about cocos2d