I have a strange bug.
An extra tab bar button appears in the lower left corner of the tab bar; it has a label but no image. It duplicates the second tab bar button.
There is an identical issue in stack overflow, but none of the suggestions there apply to my case; but you can look at the image there to see what happens.
https://stackoverflow.com/questions/45757172/uitabbar-item-title-repeated-in-the-bottom-left-corner-visual-bug
To give you more details:
this app has a storyboard with a UITabBarController subclass at its root. This subclass does nothing, except managing some global notification. No subclassing of uitabbar.
The tab bar controller has 4 items
All items are UINavigation controllers, whose root are different controllers
items 1 and 3 are pure UIKit, so we have a navigation controller and then some UIViewController subclasses
items 2 and 4 have a UINavigationController with a UIHostingController inside, and of course then it's SwiftUI
select items 2 or 4, which contain List elements
select a list item (NavigationLink) => a detail controller opens
navigate back from the detail controller
Quite interestingly, if I do this on item 2 and then on item 4 I get two extra UIBarBUttons; but if I repeat the operation over and over again I don't get anything more. So ax extra button gets added once for each operation on items 2 and 4.
It looks like some weird interaction between UINavigationController, UITabBarController and SwiftUI views. Or maybe an iOs bug, who knows.
I have implemented a hackish way to traverse the hierarchy and remove the extra views, but I would like to remove the bug at its root.
Do you have any suggestion?