UITabBarController crashes when editing the items

I'm using one UITabBarController which leads to 6 NavigationController. Therefore the user will get 4 icons displayed and one icon with three points to see the rest of the Navigation Controller.

If the user now tries to edit the list and moves one item from the hidden area towards the TabBar at the bottom, the App crashes with the error:

Exception NSException * "Can't add self as subview" 0x0000600000d16040

I can see this effect at least on both my apps. If the same compilation is run on a older iOS version, there is no crash.

Is there anything I have to take care of the configuration of the TabBar, when it comes to iOS26?

OK, I downloaded the 26.4 beta and in the simulator it is now working again. Thanks

Until 26.4 is generally available, I have found an ugly, but usable, workaround:

  1. First perform method swizzling to replace addSubiew:, then in the replacement implementation do nothing when a view is being added to it self

This will avoid the crash, but results in a graphic glitch where the selection overlay is opaque over some tabs. Very ugly. To solve this problem:

  1. Implement the tab-bar-controller delegate method to detect when customization has ended. When it has ended, set the tab-bar-controller's view-controllers to just the first view-controller, without animation. Then immediately restore the original set of view-controllers, again without animation. This will force the tab-bar to refresh and resolve the graphic glitch from (1)

  2. Finally, set the more-view-controller as the selected-view-controller again, since the re-setting of view-controllers in (2) will reset the selected tab.

With the above, I do not experience crashes, and there is about 1/2 a second of visual "glitching", but things is otherwise find afterwards.

Lastly, note that (2) will reset customizable-view-controllers.

UITabBarController crashes when editing the items
 
 
Q