With iPadOS26, if I create a UITabBar, and use that to switch between views, the selected state never updates. I created this simple UIViewController to demonstrate the issue:
class SimpleTabBarController: UIViewController, UITabBarDelegate {
let tabBar = UITabBar()
let redItem = UITabBarItem(title: "Red", image: nil, tag: 0)
let blueItem = UITabBarItem(title: "Blue", image: nil, tag: 1)
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
tabBar.items = [redItem, blueItem]
tabBar.selectedItem = redItem
tabBar.delegate = self
tabBar.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(tabBar)
NSLayoutConstraint.activate([
tabBar.leadingAnchor.constraint(equalTo: view.leadingAnchor),
tabBar.trailingAnchor.constraint(equalTo: view.trailingAnchor),
tabBar.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
])
updateBackground(for: redItem)
}
func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
updateBackground(for: item)
}
private func updateBackground(for item: UITabBarItem) {
switch item.tag {
case 0: view.backgroundColor = .systemRed
case 1: view.backgroundColor = .systemBlue
default: view.backgroundColor = .white
}
}
}
The tabBar didSelect item method is called, and the background color gets updated as expected, but the selected state of the UITabBar stays the same.
I files a feedback for a related issue: FB17841678