I've subclassed th UIScrollView and overriden the touchesShouldCancelInContentView: method the following way:
-(BOOL)touchesShouldCancelInContentView:(UIView *)view
{
if ([view isKindOfClass:[UIButton class]] || [view isKindOfClass:[UISegmentedControl class]]) {
return YES;
}
if ([view isKindOfClass:[UIControl class]]) {
return NO;
}
return YES;
}
It works perfectly for UIButton, but it doesn't work for UISegmentedControl. Any help would be appreciated
Finally figured it out. Had to subclass both UISegmentedControl and UIScrollView.
1.) added a new property for UISegmentedControl:
2.) overloaded the following methods of the UISegmentedControl:
3.) overloaded the following methods of th UIScrollview:
Works perfectly!