Reputation: 2506
I have a tableview with several sections. Now, I want to call a method with the section when the user changes the section with scrolling (user stopped scrolling in new section). Any advice?
Upvotes: 1
Views: 98
Reputation: 17958
UITableView
is a UIScrollView
. Its UIScrollViewDelegate
provides -scrollViewDidEndScrollingAnimation:
which you can use to detect when the view has stopped scrolling. The table view itself provides -indexPathsForVisibleRows
which will then allow you to determine which section(s) have cells currently visible.
Upvotes: 4