IOS 11 update management + search bar = no counter during update

I am trying to use standard UIRefreshControland UISearchControlleron UITableViewController. However, this is not like what he should do. When updating, scrolling leaves the navigation panel with a large empty area, presumably where the counter should be used:

enter image description here

I have an example project on GitHub . Here's how the controls are configured:

override func viewDidLoad() {
    super.viewDidLoad()

    let spinner = UIRefreshControl()
    spinner.addTarget(self, action: #selector(refresh), for: .valueChanged)
    refreshControl = spinner

    searchController = UISearchController(searchResultsController: nil)
    navigationItem.searchController = searchController
}

I tried to assign an update control to a property UITableViewinstead of an object UITableViewController, which doesn't matter.

Does anyone face the same problem?

+6
1

UIRefreshController -, :

override func viewDidLoad() {
    super.viewDidLoad()

    let spinner = UIRefreshControl()
    spinner.addTarget(self, action: #selector(refresh), for: .valueChanged)
    self.tableView.addSubview(spinner)

    searchController = UISearchController(searchResultsController: nil)
    navigationItem.searchController = searchController
}
0

All Articles