Post

Replies

Boosts

Views

Activity

Reply to Critical Issue in iOS 18 Beta: UITabBarController Child View Controller Incorrectly Added as UITabBarItem, Leading to Application Crash
In my case the solution was to subclass UINavigationController and forcing a tab refresh in the methods popViewController, popToRootViewController or popToViewController. It looks like the behaviour occurs in iOS 18 only. None of the dozens of suggestions found worked for me. The code could looks like this: class NavigationController: UINavigationController { override func popToViewController(_ viewController: UIViewController, animated: Bool) -> [UIViewController]? { if #available(iOS 18.0, *) { if let myTabBarController = self.parent as? MyTabBarController { myTabBarController.refreshTabs() // your method for reloading the children } } return super.popToViewController(viewController, animated: animated) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’25
Reply to App crash: Inconsistency in UITabBar items and view controllers detected. No view controller matches the UITabBarItem.
In my case the solution was to subclass UINavigationController and forcing a tab refresh in the methods popViewController, popToRootViewController or popToViewController. It looks like the behaviour occurs in iOS 18 only. override func popToViewController(_ viewController: UIViewController, animated: Bool) -> [UIViewController]? { // work-around for UITabController issue at https://developer.apple.com/forums/thread/677559 if #available(iOS 18.0, *) { if let myTabBarController = self.parent as? MyTabBarController { myTabBarController.refreshTabs() // your method for reloading view controllers children } } return super.popToViewController(viewController, animated: animated) }
Topic: UI Frameworks SubTopic: UIKit
Jan ’25