开发者

UIPanGestureRecognizer triggers too many times

开发者 https://www.devze.com 2023-04-05 06:48 出处:网络
I have a UIPanGestureRecognizer that is detecting far too many times for my liking. I need to have a counter and count 3 completed gestures. each time I pan with my finger in the recognizer spot, it t

I have a UIPanGestureRecognizer that is detecting far too many times for my liking. I need to have a counter and count 3 completed gestures. each time I pan with my finger in the recognizer spot, it triggers 3 or 4 times. has even triggered 5.

How can a recognizer be set to detect less, or wha开发者_运维百科t causes it to detect so many times?

I would like 3 single detections in a row. currently that could cause anything from 9 to 15 calls to the function.


Just use state property of your recognizer. Call your function if state == UIGestureRecognizerStateEnded.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号