How can I find out the power of a swipe for gesture recognition?

I want to move the image to the right or left using the gesture recognizer, I already move the image using the CCMoveTo function, but I don’t know how to move the image faster or slower depending on the strength of the swipe.

If the user is strongly projecting the image, the image should move faster than if the user makes soft wipes.

Anyone have any tips?

+4
source share
2 answers

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

+5
source

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

If you need more information about finger movement, you should check out UIPanGestureRecognizer .

+9
source

Source: https://habr.com/ru/post/1436229/


All Articles