touch began doesn't work in UIScrollView How to enable touch began in UIScrollView?
+2
A:
You have to subclass UIScrollView to allow interception of the touch events.
For example, you could create a "special" UISCrollView like this:
@interface TouchableScrollView : UIScrollView {
}
@end
.m file:
@implementation TouchableScrollView
- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event {
if (!self.dragging) {
[self.nextResponder touchesEnded: touches withEvent:event];
}
[super touchesEnded: touches withEvent: event];
}
@end
This example only overrides touchesEnded, but you can do the same for touchesBegan
Philippe Leybaert
2010-10-10 08:25:24
Thank you so much. How can i recognize double touch?
2010-10-10 10:12:14
Check this out: http://stackoverflow.com/questions/2637229/iphone-double-tap-fail-safe-way
Philippe Leybaert
2010-10-10 10:45:03
thank you again
2010-10-10 13:12:59