iOS 26 UISearchController always appears at the bottom instead of top with preferredSearchBarPlacement = .stacked

Hi everyone,

I’m running into a strange issue with UISearchController placement with iOS 26 SDK. In one of my view controllers, I was able to move the search bar to the top of the navigation bar by setting:

navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
navigationItem.preferredSearchBarPlacement = .stacked

This works as expected — the search bar is placed at the top.

However, in another view controller with almost identical configuration, the search bar always shows up at the bottom. If I delay the setup with DispatchQueue.main.async, it appears at the bottom; if I don’t, it doesn’t appear at all. Both VCs are wrapped in their own UINavigationController.

So my questions are:

  • Has anyone faced this issue where preferredSearchBarPlacement = .stacked is ignored?
  • Are there hidden requirements or limitations for placing the search bar at the top?
  • Why could the same setup behave differently in two controllers?

Any help or ideas would be appreciated!

Are there hidden requirements or limitations for placing the search bar at the top?

Search placements are contextual and would depend on your layout, content, and navigation structure of your app. However they're three main places you can position the entry point for search:

  • In a tab bar at the bottom of the screen
  • In a toolbar at the bottom or top of the screen
  • Directly inline with content

Why could the same setup behave differently in two controllers?

We would need more information here on how both view controllers are setup and the content.

Thank you for your reply.

I managed to resolve the issue with:

navigationItem.preferredSearchBarPlacement = .stacked

My goal was to keep the search bar integrated into the navigation bar, as it used to be prior to iOS 26.

However, with my layout I’m forced to configure both the search bar and the search controller during the view controller’s initialization.

Otherwise, system methods override these settings and the search bar ends up being placed in the bottom toolbar. In some cases, when configuring in viewDidLoad, the search bar would not appear at all — the only workarounds were to configure it in viewWillAppear or wrap the setup in DispatchQueue.main.async.


This might be the intended behavior, but if something is off on my side, I hope these observations can still be useful.

For context: the layout is relatively simple — the view controller is embedded in a UINavigationController, and the one containing the search bar consists of a UIStackView + UITableView. Three similar view controllers are placed inside a paged UIScrollView, and I navigate between them either with gestures or programmatically using scrollTo:.

iOS 26 UISearchController always appears at the bottom instead of top with preferredSearchBarPlacement = .stacked
 
 
Q