On iOS 26, UISearchController becomes non-interactive when presenting a second UISearchController from another tab of a UITabBarController.
let tabBar = UITabBarController()
let first = FirstViewController()
first.title = "First"
let second = SecondViewController()
second.title = "Second"
let nav1 = UINavigationController(rootViewController: first)
let nav2 = UINavigationController(rootViewController: second)
nav1.tabBarItem = UITabBarItem(
title: "First",
image: nil,
tag: 0
)
nav2.tabBarItem = UITabBarItem(
title: "Second",
image: nil,
tag: 1
)
tabBar.viewControllers = [
nav1,
nav2
]
The app has two tabs. Each tab has its own UINavigationController.
Tab 1:
- A UISearchController is assigned to navigationItem.searchController.
class FirstViewController: UIViewController {
private let searchController = UISearchController(
searchResultsController: nil
)
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
searchController.obscuresBackgroundDuringPresentation = false
searchController.searchResultsUpdater = self
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
definesPresentationContext = true
}
}
Tab 2:
- A button presents another UISearchController using present(_:animated:).
class SecondViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
let button = UIButton(
type: .system
)
button.setTitle(
"Open Search",
for: .normal
)
button.addTarget(
self,
action: #selector(openSearch),
for: .touchUpInside
)
button.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(button)
NSLayoutConstraint.activate([
button.centerXAnchor.constraint(
equalTo: view.centerXAnchor
),
button.centerYAnchor.constraint(
equalTo: view.centerYAnchor
)
])
definesPresentationContext = true
}
@objc private func openSearch() {
let searchController = UISearchController(
searchResultsController: nil
)
navigationController?.present(
searchController,
animated: true
)
}
}
On iOS 17 and iOS 18 this works correctly.
On iOS 26:
- The search controller appears.
- The Cancel button works.
- The search text field cannot receive touches and does not become first responder.
If I remove: navigationItem.searchController = searchController
from Tab 1, the search controller in Tab 2 works correctly.
This looks like a UIKit regression introduced in iOS 26.
Hello @Horn,
Thanks for your post, this is interesting, and it does sound like regression with 26. Have you tested if the same issue persists on the latest 27 release beta?
If so, please file a bug report using Feedback Assistant. Include a minimal sample project and explicit steps to reproduce the issue. Once complete, reply with the Feedback number in this thread, and I will make sure this report is routed to the relevant engineering team.
One idea I'd like you to check before doing so:
Tab bars are intended to be used as the root container of an app's visual architecture. Is this the case for your app? In my experience, I've seen cases of the searching having conflicting UX issues with a non-top level tab bar – restructuring for a top level tab bar helps this.
For more information see Tab Bars in the Design HIG
Travis