Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save agiletalk/941889 to your computer and use it in GitHub Desktop.
Save agiletalk/941889 to your computer and use it in GitHub Desktop.
disableScrollToTopPropertyOnAllSubViewsOf.m
// for UIScrollView
- (void)disableScrollToTopPropertyOnAllSubViewsOf:(UIView *)view {
for(UIView *subview in view.subviews) {
if([subview isKindOfClass:[UIScrollView class]]) {
((UIScrollView *) subview).scrollsToTop = NO;
}
[self disableScrollToTopPropertyOnAllSubViewsOf:subview];
}
}
// for UITableView
- (void)disableScrollToTopPropertyOnAllSubViewsOf:(UIView *)view {
for(UIView *subview in view.subviews) {
if([subview isKindOfClass:[UITableView class]]) {
((UITableView *) subview).scrollsToTop = NO;
}
[self disableScrollToTopPropertyOnAllSubViewsOf:subview];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment