Inserting self-sizing cells in UITableView dynamically scroll position jumps after loading a few pages

I load in some data from a web server to populate the table view (and also load in the image lazily, which can change the cell size). Cells self size and work fine doing this. The problem is when adding a "Loading" cell at the bottom to page content in occasionally the scroll position jumps unexpectedly after a few pages and scrolls the last inserted row to the top, instead of letting the new rows hang off the edge (in place of the "Loading" cell).


When the scroll position jumps, I seem to notice the following:


-It seems that if the total row size of inserted rows is less than tableView.bounds.size.height the scroll position goes nuts. UITableView seems to want to show the last inserted row and hijack the UI after reload.

-But if the total row size of inserted row is > bounds.size.height the scroll position isn't hijacked and everything looks a lot better.


Is there an easy way to control the scroll location after inserting rows in performBatchUpdates:?