Closed everlof closed 4 months ago
I'd try making a function that creates the final VC and use that function as ViewControllerHost param fully configuring your original VC there:
let window = UIWindow(windowScene: windowScene)
window.rootViewController = Inject.ViewControllerHost(configuredTabBarController())
func configuredTabBarController() -> UITabBarController {
let dashboardViewController = DashboardViewController()
dashboardViewController.tabBarItem = UITabBarItem(tabBarSystemItem: .favorites, tag: 0)
let historyViewController = HistoryViewController()
historyViewController.tabBarItem = UITabBarItem(tabBarSystemItem: .recents, tag: 1)
let tabBarController = UITabBarController()
tabBarController.viewControllers = [
dashboardViewController,
historyViewController,
]
return tabBarController
}
Great input, thanks, work like a charm!
Is this correctly setup for a UITabBarController in your view?
For me it seems to break completely and just show a fully gray tabbar after a reload.