I've implemented an UIScrollView which contains a grid of UIImageView objects. For both, the superview and it's subviews, userInteractionEnabled is YES. As the user scrolls and his/her finger touches an UIImageView, it imediately recognizes a tap on that, which is not what I want ;)
Inside of that UIImageView objects I have this method:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
if ([touch view] == self && [touch tapCount] >= 1) {
NSLog(@"Cooooool! The user touched me!");
}
}
Is there a way how I could recognize something like "oh no, the user actually wanted to scroll only, so don't take that touch too serious!"? Basically, what I need is the behavior of the home screen, where a finger may touch an icon, but when the user starts scrolling and lifts the finger off, the touched app will not be launched.