UITableView gets a UIScrollView for customization

I have a category for UIScrollView to customize

I need to get a UIScrollView .

I'm trying to

 UIScrollView *scroll = nil; for (UIView* subview in self.tableView.subviews) { NSLog(@"%i", self.tableView.subviews.count); if ([subview isKindOfClass:[UIScrollView class]]) { scroll = (UIScrollView *)subview; //some code } } 

But that will not work. How can I get a ScrollView ? Thanks

+4
source share
1 answer

UITableView is a subclass of UIScrollView , not a subview (or vice versa, as your code tries), so you should just use the table view directly.

+16
source

Source: https://habr.com/ru/post/1499903/


All Articles