Strange things happen when using the new iOS 11 method navigationItem.searchController
in a detailed view UISplitViewController
.
searchBar
partially appears as an empty space in the first view, and then appears in the wrong UITableViewController
, but corrects itself after a few taps and protrusions UITableViewController
.
I used searchBar
to tableHeaderView
, but I changed the code as recommended by WWDC:
if (@available(iOS 11.0, *)) {
self.navigationItem.searchController = self.searchController;
self.navigationItem.hidesSearchBarWhenScrolling = NO;
} else {
self.tableView.tableHeaderView = self.searchController.searchBar;
}
This example uses a standard code example (default project for UISplitViewController
and Apple demo UISearchController
updated for iOS 11 (using one UITableViewController
)).
The initial view containing searchController
is as follows:

UITableView
, :

UITableView
- , :


, Apple UISearchController
, - . , UISplitViewController
. , UINavigationController
. , sek UINavigationController
- ( ). segue to modal .

, : UISplitViewController UISearchController UISearchBar
, ( : searchControllerDemo)
, . .