IOS 8 UITableView self-sizing cells jump/shift visually when a new view controller is pushed IOS 8 UITableView self-sizing cells jump/shift visually when a new view controller is pushed ios ios

IOS 8 UITableView self-sizing cells jump/shift visually when a new view controller is pushed


Okay, I solved it by caching my cell heights in sizeThatFits, and returning that value for estimated cell heights within the delegate. Works beautifully.


Quick fix:

override func viewWillDisappear(animated: Bool) {    super.viewWillDisappear(animated)    self.tableView.reloadData()}

Edit: After spending hours on this and similar issues I've found the best solution is to cache the cell heights and return them in estimatedHeightForRowAtIndexPath delegate method, the problem is caused by estimated heights being really inaccurate.

I cached the heights in tableView(_:willDisplayCell:forRowAtIndexPath:) into a dictionary with the unique ID's for the data as keys this way when data gets added or updated I can just remove that height from the cache and use better estimated heights so only that cell uses an estimated height. So far this solves all my jumping and scrolling issues.