Question

I have a Clear-like UITableView which contains multiple cells. Each cell has a UIPanGestureRecognizer attached and it works as expected, but I want the table view to recognize just one pan gesture recognizer, not multiple. I tried to use the gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: but it doesn't work. I think it's because it only affects multiple UIGestureRecognizers on the same view and not in multiple views.

I need some help. How can I make it?

Was it helpful?

Solution

Keep a variable in the table view to indicate whether there is an active gesture or not. Set its value according to gesture state, that is UIGestureRecognizerStateBegan or UIGestureRecognizerStateEnded. Then, ignore touches when there is already one gesture that has not ended yet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top