Possible UIRefreshControl bug when prefersLargeTitles is turned on

Setup:

  • UINavigationController with prefersLargeTitles set to true on the nav bar
  • Initial view controller in nav controller: UIViewController with UIScrollView as main view's first subview
  • UIScrollView has refresh control property set to UIRefreshControl
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(reloadData), for: .valueChanged)
mainScrollView.refreshControl = refreshControl


Problem:

When I pull to refresh, the UIRefreshControl's indicator tries to spin but the .valueChanged event is not fired. If I navigate to the next view controller in the nav stack and come back to the first view controller, it works fine. The .valueChanged event is fired and reloadData() function is called. If I set prefersLargeTitles to false, it works fine from the start without navigating away from the initial view controller.


Has anyone else noticed this?

I have same problem, I changed to viewDidAppear. but the loader disappears

The bug still remains in iOS 14.7 beta 2.

But there's one way to solve the issue.

Just set your UITableView top layout constraint attach to super view, instead of attaching to safe area.

Remember this is just like a hack. We should still wait to be fixed the bug by Apple.

Possible UIRefreshControl bug when prefersLargeTitles is turned on
 
 
Q