So if you want to make the initial view controller a tab bar, you just make a Tab Bar Controller, drag to connect to the view controllers, and set the Tab Bar Controller as the initial view controller.
But say after these tab bars, you currently segue with button press to a view controller called homepage. In SceneDelegate, this homepage is set to rootViewController if the user is logged in, otherwise it is the initial Tab Bar controller.
So, how do you go about making homepage have a Tab Bar with two other View Controllers that are currently being segued from homepage by button presses. You can make a Tab Bar Controller in Storyboard and connect it to the the 3 VC's, but you can't set the Tab Bar Controller as initial view controller
If you need to set a different rootViewController based on your authorization status, simply set
rootViewController.Be sure you don't specify Launch Screen File, otherwise, the code will not work and use your storyboard by default.
Your ViewController in Storyboard must has unique StoryboardID, for example:
And the code will be look like this:
Here in the code you can initiate any
UIViewControllerfrom your.storyboardand add it to yourUITabBarViewControlleras a tab.