Here is a mini project that shows the bug (BETA 3).
https://file.io/fkrDXwYfgyAs
Screenshot:
class RotatingTabBarControllerSwift: UITabBarController {
private var myAppDel = AppDelegate()
// MARK: - Methoden
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
self.updateTabBarItems()
}
// MARK: - Helper Methoden
func updateTabBarItems() {
if let items = self.tabBar.items {
print("# UPDATED")
let symbolConfig = UIImage.SymbolConfiguration(weight: .light)
items[0].image = UIImage(systemName: "house.fill", withConfiguration: symbolConfig)
items[1].image = UIImage(systemName: "person.fill", withConfiguration: symbolConfig)
items[0].title = "Code 1"
items[1].title = "Code 2"
self.tabs[0].title = "Code 3"
self.tabs[1].title = "Code 4"
// Tabbar in compact style still shows "Storyboard 1" and "Plus" image ... it should show "Code 1" (or even better "Code 3") and a "House" image
}
}
}
Post
Replies
Boosts
Views
Activity
Yes, it worked in iPadOS 17. And yes, I changed the title of the tabbar item exactly there (viewWillLayoutSubviews) …
As described above, I create the UITabBarController with the storyboard and name the first item "Storyboard".
Then I change the name to "Code" with the following code:
theTabBarController.tabBar.items[0].title = "Code"
// By the way, this doesn’t work at all ... ?!
theTabBarController.tabs[0].title = "Code"
The new tab bar is displayed correctly:
But as soon as I reduce the window on the iPad and the compact size is triggered, the "old" tab bar appears at the bottom of the window:
Instead of "Code", the first item still shows "Storyboard". I could imagine that the problem has something to do with the fact that I create the UITabBarController using the storyboard. But that should still work, right?
(The tab bar is displayed correctly on the iPhone, by the way. So for me the problem is limited to the iPad only.)
I can confirm. It's Beta 6 - and TipKit is broken and Widgets are broken (https://developer.apple.com/forums/thread/735825). Both works before ...
Seems like a bug in Beta 6 (FB12974903). Look here: https://mastodon.social/@_Davidsmith/110897587368893341