I have an app with a tab bar. The icons in the tab bar are white and the background is black. This always worked and the app is actually published like this and works fine. However today I opened the project after a few months to make some changes and it turns out the tab bar is now transparent on all screens but one. No changes have been made to the tab bar code.
This is the code I'm using within my tabBarViewController class:
vc1 = HomeViewController()
vc2 = LibraryViewController()
vc3 = SearchViewController()
vc4 = MyStuffViewController()
vc2?.title = "Library"
vc3?.title = "Search"
vc4?.title = "My Stuff"
let nav1 = UINavigationController(rootViewController: vc1!)
let nav2 = UINavigationController(rootViewController: vc2!)
let nav3 = UINavigationController(rootViewController: vc3!)
let nav4 = UINavigationController(rootViewController: vc4!)
nav1.tabBarItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house"), tag: 1)
nav2.tabBarItem = UITabBarItem(title: "Library", image: UIImage(systemName: "tv"), tag: 1)
nav3.tabBarItem = UITabBarItem(title: "Search", image: UIImage(systemName: "magnifyingglass"), tag: 1)
nav4.tabBarItem = UITabBarItem(title: "My Stuff", image: UIImage(systemName: "bookmark"), tag: 1)
nav1.navigationBar.barTintColor = .black
nav2.navigationBar.barTintColor = .black
nav3.navigationBar.barTintColor = .black
nav4.navigationBar.barTintColor = .black
nav1.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.white]
nav2.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.white]
nav3.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.white]
nav4.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.white]
setViewControllers([nav1, nav2, nav3, nav4], animated: false)
The right controllers are being called but the nav bar remains tranparent in every case except the SearchController.