user773578
user773578

Reputation: 1161

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 what 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.

Upvotes: 3

Views: 1268

Answers (1)

Vlad Tsepelev
Vlad Tsepelev

Reputation: 2046

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

Upvotes: 11

Related Questions