Swift版 ScrollView和UITouch事件冲突

前端之家收集整理的这篇文章主要介绍了Swift版 ScrollView和UITouch事件冲突前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

OC版地址:http://www.jb51.cc/article/p-eojmeebq-em.html

extension UIScrollView {
    override public func  touchesBegan(touches: Set<NSObject>,withEvent event: UIEvent) {
        self.nextResponder()?.touchesBegan(touches,withEvent: event)
    }
    public override func touchesMoved(touches: Set<NSObject>,withEvent event: UIEvent) {
        self.nextResponder()?.touchesMoved(touches,withEvent: event)
    }
    public override func touchesEnded(touches: Set<NSObject>,withEvent event: UIEvent) {
        self.nextResponder()?.touchesEnded(touches,withEvent: event)

    }
}
原文链接:https://www.f2er.com/swift/326249.html

猜你在找的Swift相关文章