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.
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow()
window?.windowScene = windowScene
window?.rootViewController = MusicTabBarController()
window?.makeKeyAndVisible()
}
}
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .blue
}
}
class SearchViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .orange
}
}
these are my SceneDelegate and ViewControllers codes, code of my main controller is on the screenshot
2
Answers
this piece of code helped to solve my problem
Zhiger Sairan
your TabBar isn’t disappeared. As I can see on view debugger
You have to set image or/and title to your tabbarItem in UIViewControllers.
It’s small code example, that helps: