UIScrollView 获取touchesBegan事件

要实现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事件)