How can I Know the force of a swipe Gesture Recognizers?

I want to move a image to the right or to the left with the swipe gesture recognizer, i´m already moving the image using the CCMoveTo function, but I don´t know how move the image faster or slower depends of the force of the swipe.

If the user make a strong swipe the image should move faster than if the user make a soft swipe.

Anyone have any advice?


That's what the property velocity in the UIPanGestureRecognizer is for. You can see an example of how to use it in class 08 (I think) of cs193p by Paul Hegarty. Here's the link to download it from iTunes U


A UISwipeGestureRecognizer is a one shot thing. It fires when the device detects the gesture and is done after that.

If you want more information about the movement of the finger you should check UIPanGestureRecognizer.

链接地址: http://www.djcxy.com/p/27044.html

上一篇: 向右滑动Facebook风格的导航/布局

下一篇: 我怎样才能知道滑动手势识别器的力量?