Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Call A Function When Swipe Gesture Ends

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.

like image 853
hklel Avatar asked Jul 09 '26 19:07

hklel


1 Answers

Check the gesture state like this:

if gesture.state == UIGestureRecognizerState.Ended { //code }
like image 97
Maysam Avatar answered Jul 13 '26 14:07

Maysam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!