新建继承 UIScrollView
的子类,重写 touch
方法
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesMoved:touches withEvent:event];
if (!self.dragging) {
[[self nextResponder] touchesMoved:touches withEvent:event];
}
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
if (!self.dragging) {
[[self nextResponder] touchesBegan:touches withEvent:event];
}
}
网友评论