I am currently trying to add an infinite scroll to UITableView, which contains several calendar events. Since the title of the event does not always fit within the same line, I added a multi-line to the cell UILabel. To calculate cell height, I use UITableViewnew cells for self-calibration using the automatic layout in iOS 8. WWDC Session 226 talks about this in more detail.
To implement an infinite scroll mechanism, I redefine layoutSubviewswhere I need to calculate the height of the section, which is not displayed on the screen at a time. This can be done using [self rectForSection:0]. In doing so, the table returns a height based on the estimated row size that I had to determine inside the table initializer in order to work with self-sized cells.
self.estimatedRowHeight = 44.0;
self.rowHeight = UITableViewAutomaticDimension;
When a section hits the screen, I get the correct section size, but since I need to update the contentOffset table based on the calculated height of that particular section, this will make my table jump up and down.
Any ideas on how to solve this? Is there a way to get a section to return the actual height, rather than an estimate?