UIPanGestureRecognizer和collecti

2017-07-10  本文已影响0人  jianshufei
override func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool {
    if let panGestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer {
        let translation = panGestureRecognizer.translationInView(collectionView!)
        if fabs(translation.y) > fabs(translation.x) {
            return true
        }
        return false
    }
    return false
}
上一篇下一篇

猜你喜欢

热点阅读