I have a swipe gesture recogniser in my app, but how can I call a function every time the swipe ends (i.e. call when the user finish swiping and lift up his/her finger)? Thanks.
Asked
Active
Viewed 1,675 times
3
-
2possible duplicate of [How to recognize swipe in all 4 directions](http://stackoverflow.com/questions/24215117/how-to-recognize-swipe-in-all-4-directions) – Shamas S Aug 30 '15 at 09:25
1 Answers
4
Check the gesture state like this:
if gesture.state == UIGestureRecognizerState.Ended { //code }

Maysam
- 7,246
- 13
- 68
- 106
-
I added `if swipeRightGesture.state == UIGestureRecognizerState.Ended { println("end") }` to the `update` function in my `SKScene`, but nothing was printed in console. Any suggestion? – hklel Aug 30 '15 at 10:00