views:

68

answers:

1

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
Thank you so much. How can i recognize double touch?
Check this out: http://stackoverflow.com/questions/2637229/iphone-double-tap-fail-safe-way
Philippe Leybaert
thank you again