I recently started rewriting an iOS app to use the new UISearchControllerand universal storyboard. My application is available for both devices (iPhone and iPad), so changing the universal storyboard using UISplitViewControllerwas a big advantage.
But, unfortunately, it UISearchControllerdoes not work as expected. I added UISearchControllerwith 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 UISearchBarcovered 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, , ,