I have a simple app with a TableView but without a NavigationBar/NavigationController. The app also has a UISearchController with a SearchBar that is always visible. I tried to hide the status bar with prefersStatusBarHidden and that works fine. Until the SearchBar is activated. Then the status bar will appear again.
How can I prevent this and keep the status bar hidden?
var cityRepository:CityRepository?
var searchController:UISearchController?
override func viewDidLoad()
{
self.cityRepository = CityRepository()
self.searchController = UISearchController(searchResultsController: nil)
self.searchController!.searchResultsUpdater = self
self.searchController!.dimsBackgroundDuringPresentation = false
self.definesPresentationContext = true
self.tableView.tableHeaderView = searchController?.searchBar
//* Already tried this ....
self.edgesForExtendedLayout = UIRectEdge.None
self.extendedLayoutIncludesOpaqueBars = true
self.automaticallyAdjustsScrollViewInsets = false
super.viewDidLoad()
}
override func prefersStatusBarHidden() -> Bool
{
return true
}