I am using UISearchController
to search for data in my tableview. I am not using table view controller. I would like to hide the navigation bar when my search b
You can add content inset from the top instead of adding a header.
self.tableView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
and when willDismissSearchController (UISearchController's delegate method) is called, return the insets to 0
self.tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
This way, you'll avoid the whitespace when it's not active.