I inserted a UITableView inside another UIViewController's view.
but when I tap the status bar at the top of the screen; the table view doesn't scroll to the top which is the expected behavior within iOS apps.
I tried :
[self.tableView setScrollsToTop:YES];
but the tableview still not scroll to top when tap the top of the screen.
You have to set
scrollsToToptoNOon all the other scroll views in your hierarchy. If more than one scroll view hasscrollsToTopset toYES, none of them will scroll to top when the status bar is touched. This is mentioned in the documentation of thescrollsToTopproperty.Keep in mind that this also applies to any subclasses of
UIScrollViewin your view hierarchy, and thatUITableView,UIContainerView, andUITextVieware subclasses ofUIScrollView.