I recently started rewriting an iOS app to use the new UISearchController
and universal storyboard. My application is available for both devices (iPhone and iPad), so changing the universal storyboard using UISplitViewController
was a big advantage.
But, unfortunately, it UISearchController
does not work as expected. I added UISearchController
with the following lines:
self.searchController = UISearchController(searchResultsController: nil)
self.searchController.searchBar.sizeToFit()
self.searchController.dimsBackgroundDuringPresentation = false
self.myTableView.tableHeaderView = self.searchController.searchBar
self.searchController.searchResultsUpdater = self
self.definesPresentationContext = true
My controller chain is this:
UISplitViewController
UITabbarController (Master)
UINavigationController
UITableViewController
UINavigationController (Detail)
UINavigationController
UIViewController
The problem is that the iPad application is UISearchBar
covered UINavigationBar
. But if I switch the tabs and get back to view. Is displayed UISearchBar
. So somehow, after switching tabs, he correctly redraws the view. In the iPhone version, it is automatically fixed.
iPad App
UISearchBar
UINavigationBar

UISearchBar

iPhone App
iPhone , .

:
- Edges
- SearchController viewWillAppear, , ,