Reputation: 63
I have UIScrollView
that has many subviews. When I scroll, I want to tap on a subview which I want to be dragged. Is there a possible way to make the UIScrollView
stop from swallowing touches? Or is it possible to start new touch when you cancel the scrolling (like what it scrolls and I tapped on it, the subview will be tapped as well so I can drag it out)?
Upvotes: 1
Views: 4371
Reputation: 3024
Subclass UIScrollView and override the - (BOOL)touchesShouldCancelInContentView:(UIView *)view
method. Here's an example to allow uibutton touches to pass through:
#import "scrollViewWithButtons.h"
@implementation scrollViewWithButtons
- (BOOL)touchesShouldCancelInContentView:(UIView *)view
{
return ![view isKindOfClass:[UISlider class]];
}
@end
Upvotes: 2