How do I detect a swiping / flicking gesture?
I want to allow the user to flick a ball that is on screen. The user would tap on the ball and then flick, the velocity / speed of the flick would then dictate initial velocity.
I took a look at UISwipeGestureRecognizer but it seems like that is more target开发者_开发问答ed at navigation than flicking.
How do I go about implementing this?
I am using Cocos2d and Box2d.
Have you considered UIPanGestureRecognizer? You can get velocity data from that ([panGesture velocityInView:]), and distinguish the initial velocity of the 'swipe' using the state property on the gesture recognizer.
Or is that not sufficient?
精彩评论