I’m using the UIView tableFooterView of in my UITableView to show a “Loading more” label at the bottom of my table. When the UIView in tableFooterView is shown, I need to start some lazy download of content. How do I know when the tableFooterView is displayed?
Share
Instead of determining when the footer view will show you could check when the last row of the table is being requested and load the data then. The number of times a user scrolls to the very last row without scrolling down to see the footer are probably very few. The effect will be the same, i.e. you know when the user has scrolled to the bottom and you should load more data.
This can quite easily be implemented in
tableView:cellForRowAtIndexPath:. By keeping track of what IndexPath is the last one, and updating it every time new rows are added or deleted, you can simply check if the IndexPath of the requested cell is the same as the IndexPath of the last row and trigger the lazy loading of more data from there, the same way you are currently doing it.