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.
iOS - Recognize UIPanGestureRecognizer just for one UITableViewCell
-
28-06-2022 - |
문제
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?
해결책
제휴하지 않습니다 StackOverflow