, , . , , ToTop. , , . , , viewDidAppear. , , 0.
-(void)inspectViewAndSubViews:(UIView*) v level:(int)level {
NSMutableString* str = [NSMutableString string];
for (int i = 0; i < level; i++) {
[str appendString:@" "];
}
[str appendFormat:@"%@", [v class]];
if ([v isKindOfClass:[UITableView class]]) {
[str appendString:@" : UITableView "];
}
if ([v isKindOfClass:[UIScrollView class]]) {
[str appendString:@" : UIScrollView "];
UIScrollView* scrollView = (UIScrollView*)v;
if (scrollView.scrollsToTop) {
[str appendString:@" >>>scrollsToTop<<<<"];
}
}
NSLog(@"%@", str);
for (UIView* sv in [v subviews]) {
[self inspectViewAndSubViews:sv level:level+1];
}}
.
→ > scrollsToTop < < , , .