I am using the new property of the iOS 11 searchContoller
property UINavigationItem
. I am running the build of iOS 11.0 GM.
When I execute a push sega while the active search controller is active, it works fine. When I jump back again, the search bar crashes and shrinks in the status bar. I cannot cancel the search or change the search text.
See the following image sequence:

pop segue . , . 90% , . , -, . , , .
, , . viewDidLoad()
:
searchController = UISearchController(searchResultsController: nil)
searchController.dimsBackgroundDuringPresentation = false
searchController.searchBar.returnKeyType = .done
searchController.searchBar.placeholder = "Your Library"
searchController.searchBar.searchBarStyle = .minimal
clearsSelectionOnViewWillAppear = false
if #available(iOS 11.0, *) {
navigationItem.searchController = searchController
navigationController!.navigationBar.prefersLargeTitles = true
}
else {
searchController.searchBar.backgroundColor = tableView.backgroundColor!
searchController.hidesNavigationBarDuringPresentation = false
tableView.tableHeaderView = searchController.searchBar
tableView.setContentOffset(CGPoint(x: 0, y: searchController.searchBar.frame.height), animated: false)
}
Apple Messages (. ), "", "" "", , , IOS 11.

→ → → , ( ). viewDidAppear
, searchController.searchBar.frame.height
0
( viewDidDisappear
, viewWillAppear
). , :
override func viewDidAppear(_ animated: Bool) {
if #available(iOS 11.0, *), searchController.searchBar.frame.height == 0 {
navigationItem.searchController?.isActive = false
}
super.viewDidAppear(animated)
}
?