Hello, I have a question I followed along and my issue is that the border of the tab bar is shown bottom. But it does not show the top of the phone. The style of the bar is there at the bottom. But when Today is shown it shows without the border. The code is below.
import UIKit
class BaseTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
viewControllers = [
createNavController(viewController: UIViewController(), title: "Today", imageName: "today_icon"),
createNavController(viewController: UIViewController(), title: "Apps", imageName:"apps" ),createNavController(viewController: UIViewController(), title: "Search", imageName: "search"),
]
}
fileprivate func createNavController(viewController:UIViewController,title: String, imageName:String) -> UIViewController {
let navController = UINavigationController(rootViewController: viewController)
viewController.navigationItem.title = title
viewController.view.backgroundColor = .white
navController.tabBarItem.title = title
navController.navigationBar.prefersLargeTitles = true
navController.tabBarItem.image = UIImage(named: imageName)
return navController
}
}
Here is my scene delegate : Am I missing something? Best and thank you!
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(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
window?.rootViewController = BaseTabBarController()
window?.makeKeyAndVisible()
}