美文网首页
UIScrollView 获取touchesBegan事件

UIScrollView 获取touchesBegan事件

作者: CarrieQ | 来源:发表于2016-11-29 11:47 被阅读201次

    要实现UIScrollView上获取touchesBegan事件 其实并不难,我们在UIscrollView里面加一个类扩展,传递给上一级即可,具体实现如下

    @implementation UIScrollView (UITouch)// 让touchesBegan传递下去- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent *)event 
    
    {
    
        // 选其一即可
    
        [super touchesBegan:touches withEvent:event];
    
        //    [[self nextResponder] touchesBegan:touches withEvent:event];
    
    }
    

    相关文章

      网友评论

          本文标题:UIScrollView 获取touchesBegan事件

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