Wrong UINavigationBar large title positioning after UIRefreshControl ends when using self sizing tableView cells

Number:rdar://FB7645786 Date Originated:30/03/2020
Status:Open Resolved:
Product:iOS Product Version:13.0
Classification:Regression Reproducible:Often
Description : 

UINavigationBar set to use large titles doesn’t reposition itself properly after calling UIRefreshControl.endRefresh when showing UITableView with self sizing cells on iOS 13. It behaves as expected on iOS 12.

Steps to reproduce : 

- download attached project
- set return value of with ViewController.tableView(_ :estimatedHeightForRowAt:) to 800
- run the project on iOS 13 and trigger a refresh
- it will often happen that after UIRefreshControl.endRefresh() is called the tableView contentOffset will be wrong and hide some content
- run it again with an estimated cell heigh of 20
- it will always reposition properly

After tests on a real device I can confirm this behaviour doesn’t seem to happen on iOS 12.4 and is therefore a regression.

Estimated cell heights are often fine tunes by developers to prevent scrollbars from jumping around too much while scrolling a tableView with self sizing cells. They are rarely set to the minimum value a cell height is expected to be, especially when supporting adaptative font sizes, but rather to the expected median value a cell height can have when using a default font size. This makes having UINavigationBar messing up the tableView offset in those cases an important bug.

Attachments : cf https://github.com/dvkch/UINavigationBar-LargeTitle-UIRefreshControl


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!