I would like to know when a UITableView
did scroll to bottom in order to load and show more content, something like a delegate or something else to let the controller know when the table did scroll to bottom.
Does anyone know this, please help me, thanks in advance!
in the tableview delegate do something like this
The best way is to test a point at the bottom of the screen and use this method call when ever the user scrolls (
scrollViewDidScroll
):Test a point near the bottom of the screen, and then using the indexPath it returns check if that indexPath is the last row then if it is, add rows.
in
Swift
you can do something like this. Following condition will be true every time you reach end of the tableviewMy solution is to add cells before tableview will decelerate on estimated offset. It's predictable on by velocity.
None of the answers above helped me, so I came up with this:
UITableView
is a subclass ofUIScrollView
, andUITableViewDelegate
conforms toUIScrollViewDelegate
. So the delegate you attach to the table view will get events such asscrollViewDidScroll:
, and you can call methods such ascontentOffset
on the table view to find the scroll position.