Everyone
I have a problem and I have been searching the solution but could not find any. I am working on a tab bar based app. Problem is that I want to hide tab bar at first screen and then show it on all other screens that are being displayed after first screen.
Can anyone please give me the best solution for this problem?
Actual scenario is that I have a screen that is login screen. Now i dont want to show tab bar here as tab bar will be displayed only if the user is signed in. When user logs in, I want the tab bar to be displayed showing its contents.
Best Regards
If you have your Tab Bar Controller as your
rootController, you can userootController.selectedIndex =0for selecting 1st Tab bar Item, androotController.selectedIndex =1;and so forth.As soon as that particular view loads, you can load the other views in an array, and then add it to the
rootController.selectedIndexandreloadInputViewswith animation.Edit: (as per the comments)
So you have a tab bar controller, and you want to show the introduction and the login screen while starting the App. If login is successful, you want to present the tab bar controller ! This can be done with
ModalViewControllersIn the
ViewDidLoadof the view that loads up first, (it’s your first tab by default), addNow your introduction screen would load as soon as your first tab bar loads. But the loading is instantaneous, so it’s not visible to the user’s eye. Now reference your Login View Controller like
@class LoginControllerand create an objectLoginViewController *lvc;, and synthesize it. Now declareLoginButtonand in theIBActionAnd in the
LoginViewController, if Login is successful, just do