UIGestureRecognizer over UIScrollView

2019-04-07 03:44发布

I need to detect left and right swipe over a UIScrollView with 3 fingers when horizontal scrolling is possible. I need to keep all the interactions with 1 and 2 fingers. Is it possible to do that without rewrite all gesture recognision.

Thank you

1条回答
萌系小妹纸
2楼-- · 2019-04-07 04:30

It's possible. Add a swipe gesture to your UIScrollView and be sure to implement

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

So they will not cancel each other.

查看更多
登录 后发表回答