He everyone, I work on my project.
Below my storyboard and my old code.
I want to delete the Tabbar in the storyboard and created by code. I did it.
So if my tabBar is not set on any storyboard, how I can navigate from my login screen to my travels list screen without providing storyboard identifier?
Sorry for my English, I don’t speak English very well.
func goToNextScreen() {
performSegue(withIdentifier: "GoToTravelListScreen", sender: userLoged)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "GoToTravelListScreen" {
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let listTravelVC = storyboard.instantiateViewController(withIdentifier: "mainTabBar") as! UITabBarController
listTravelVC.modalPresentationStyle = .fullScreen
self.present(listTravelVC, animated: true, completion: {
let navController = listTravelVC.viewControllers![0] as! UINavigationController
let vc = navController.topViewController as! TravelListViewController
vc.userLoged = self.userLoged
})
}
}
2
Answers
After seeing your code and image you attached you need to put these lines
// Login screen controller
put this code on login controller
from above code you will use the login controller navigation stack
You can use