开发者

UIGestureRecognizer over UIScrollView

开发者 https://www.devze.com 2023-03-14 04:54 出处:网络
开发者_开发百科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
开发者_开发百科

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号