美文网首页
iOS手势区分

iOS手势区分

作者: nick5683 | 来源:发表于2021-06-07 23:51 被阅读0次

        public funcgestureRecognizer(_gestureRecognizer:UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer:UIGestureRecognizer) ->Bool{

            let location = gestureRecognizer.location(in: headerView)

            if headerView.frame.contains(location){

                return false

            }

            //禁止segmentedView左右滑动的时候,上下和左右都可以滚动

            if otherGestureRecognizer == segmentedView.collectionView.panGestureRecognizer {

                return false

            }

            return gestureRecognizer.isKind(of: UIPanGestureRecognizer.self) && otherGestureRecognizer.isKind(of: UIPanGestureRecognizer.self)

        }

    相关文章

      网友评论

          本文标题:iOS手势区分

          本文链接:https://www.haomeiwen.com/subject/mpgzsltx.html