It is visible if i comment part where i set my ViewControllers.
It is like been superimposed by other ViewControllers. Cause it works but i can't see it.
When i tap bottom parts of screen color of screen changes to colors which i assign to controllers.
You have to set image or/and title to your tabbarItem in UIViewControllers.
It's small code example, that helps:
class MusicTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .gray
let searchVC = SearchViewController()
searchVC.tabBarItem.title = "SearchViewController"
let playerVC = ViewController()
playerVC.tabBarItem.title = "ViewController"
viewControllers = [
searchVC,
playerVC
]
}
}
CodePudding user response:
this piece of code helped to solve my problem
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .white
tabBar.standardAppearance = appearance
tabBar.scrollEdgeAppearance = tabBar.standardAppearance