This is going to be gnarly, so I'll simplify in this first iteration.
Headline: A UISearchController on top of a Z (not enclosure) stack of UINavigationControllers puts the search bar for the result controller out of site above the top of the screen. The search field is unusable and there's no way to escape that screen.
---
I've inherited an app that presents a number of modules for things like maps, calendar, news, there are several. The original team rooted the window in a UINavigationController [number 1, it'll be clear why I'm numbering], rooted at a scrolling dashboard for choosing a module. The maps module used UISearchDisplayController, long since deprecated and now broken.
I hoped simply to drop UISearchController in and be done. The search field appeared in the nav bar, and the search results controller appeared — as far as it goes. But the results controller covers the entire screen, apparently takes First Responder from the search field, and affords no way to dismiss the (always-empty) results table.
---
Apparently the original design has it that when you select the Maps module, the dashboard view [nav controller 1] slides another navigation controller [2] over the one that's the window root controller. The search field appears in the navigation bar of this new controller.
When you tap the search field and start typing, the search controller slides yet another nav controller [3] to hold the results view (for which I use a UITableViewController as the root-and-only content). It's not entirely clear, but it appears from the view debugger that there is a search field bar on top of the table, but the enclosing view (apparently UIKit-generated to host the field and the results table) is constrained to place the search bar above the top of the screen.
(I'm filing a bug on the Xcode view debugger for how difficult it is to examine your own view hierarchy among scores of UIKit-generated views and layers. I'm sure this post is inaccurate because I'm confused.)
Window
Nav controller 1
Dashboard
Nav controller 2
Search controller search field in nav bar
Map view + accessories
Nav controller 3
Results UITableView filling the screen
Search bar above the results table, above the top of the screen
Yes, the three nav controllers are stacked in Z order, not nested. I'm stuck at line 9 above. I've tried every configuration option I can think of. I've tried forcing the constraints in code.
How can I get the final search bar to appear on screen?