I am using this tutorial to implement a pull-to-refresh behavior with the RefreshControl
. I am using a Navigation Bar
. When using normal titles everything works good. But, when using "Prefer big titles" it doesn't work correctly as you can see in the following videos. Anyone knows why? The only change between videos is the storyboard check on "Prefer Large Titles".
At the end what worked for me was:
In order to fix the RefreshControl progress bar disappearing bug with large titles:
self.extendedLayoutIncludesOpaqueBars = true
In order to fix the list offset after refreshcontrol.endRefreshing()
:
let top = self.tableView.adjustedContentInset.top
let y = self.refreshControl!.frame.maxY + top
self.tableView.setContentOffset(CGPoint(x: 0, y: -y), animated:true)
If you have opaque tab bar and the self.extendedLayoutIncludesOpaqueBars = true makes everything go under the tab bar and you don't want this behavior then you can add 'self.edgesForExtendedLayout = UIRectEdge.top'
First part helped me!
Check if you have any missing call of tableView.reloadData() before fixing the list offset, e.g. if you update tableHeaderView, you should call reloadData() immediately after it.