In iOS 4 I believed -touchesBegan:withEvent:, -touchesMoved:withEvent:, -touchesEnded:withEvent:, -touchesCancelled:withEvent: were the only methods available to implement in a view to handle touches.
But now when I override these methods like this:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
// not calling super. Doing nothing.
}
in a UIScrollView subclass, it still scrolls. How did they do it?
UIScrollView uses a UIPanGestureRecognizer to scroll. UIKit sends events to gesture recognizers through a private mechanism, separate from touchesBegan:withEvent: and related methods.