How would you setup the gesture recognizers so that you could have a UISwipeGestureRecognizer and a UIPanGestureRecognizer work at the same time? Such that if you touch and move quickly (quick swipe) it detects the gesture as a swipe but if you touch then move (short delay between touch & move) it detects it as a pan?
I've tried various permutations of requireGestureRecognizerToFail and that didn't help exactly, it made it so that if the SwipeGesture was left then my pan gesture would work up, down and right but any movement left was detected by the swipe gesture.
You're going to want to set one of the two
UIGestureRecognizer
's delegates to an object that makes sense (likelyself
) then listen, and returnYES
for this method:This method is called when recognition of a gesture by either
gestureRecognizer
orotherGestureRecognizer
would block the other gesture recognizer from recognizing its gesture. Note that returningYES
is guaranteed to allow simultaneous recognition; returningNO
, on the other hand, is not guaranteed to prevent simultaneous recognition because the other gesture recognizer's delegate may returnYES
.