UIPanGestureRecognizer triggers too many times
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.
精彩评论