Problem with new UITabbarController on IOS 18 beta (Bug?)

In my project, I create a UITabbarController using the storyboard. Later, I change the images and title of the individual tabbar items in the code. This works with the new tabbar controller from iOS 18, with one exception: If the iPad switches to a horizontally compact mode and thereby triggers the old tabbar (at the bottom of the screen), the images and titles from the storyboard appear there, not the values ​​changed in the code. Am I doing something wrong or is this a bug?

Answered by Frameworks Engineer in 791289022

It’s hard to tell what’s happening without seeing a code sample. Could you file a developer feedback through the Feedback Assistant and attach a sample project that reproduces this issue to help us investigate the issue?

It’s hard to tell what’s happening without seeing a code sample. Could you file a developer feedback through the Feedback Assistant and attach a sample project that reproduces this issue to help us investigate the issue?

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.)

Likely, the content is reloaded from storyboard.

  • Did it work OK in iPadOS 17 ?
  • where do you set set theTabBarController.tabBar.items[0].title

Did you try to set theTabBarController.tabBar.items[0].title for instance in

    override func viewWillLayoutSubviews() { 

Yes, it worked in iPadOS 17. And yes, I changed the title of the tabbar item exactly there (viewWillLayoutSubviews) …

Problem with new UITabbarController on IOS 18 beta (Bug?)
 
 
Q