yongyuandouneng/YNPageViewController

建议子页面协议化,防止篡改UIGestureRecognizerDelegate导致的问题

jw10126121 opened this issue · 1 comments

public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    
    if let vc = self.jw.viewController() {
        
        if vc is FineGoodsSectionItemBaseVCDelegate {  // 只有当子页面实现这个协议,才可能返回true
            
            let canGes = gestureRecognizer.isKind(of: UIPanGestureRecognizer.self)
                && otherGestureRecognizer.isKind(of: UIPanGestureRecognizer.self)
            return canGes
            
        }
    }
    
    return false
}

麻烦你加Q群说明一下具体造成的原因哈。