0

I am trying to initalize a view controller, which will be loaded once the Tab Bar controller starts.

For example, initially the Tab Bar Controller is not shown, once you log in, the tab bar controller is there.

Because the Tab Bar Controller isn't loaded when the app is loaded, I can't reference the View Controllers inside the Tab Bar Controller (to my knowledge). So what I am trying to do is in the AppDelegate, create an instance of a view controller class, set some properties, and when the Tab Bar Controller is loaded, and the View Controller is loaded, initialize it with the instance of the class I created in the AppDelegate.

Is any of this possible, or is there a better way that I am not thinking of?

Bobby W
  • 836
  • 8
  • 22

1 Answers1

0

One way to approach this is to have your initial [login] view contained within the UITabBarController, set the tab bar to hidden (see this SO post on hiding a tab bar), and once logged in show the tab bar. The user will not notice that the login view is contained within a tab bar, and you can set up your other view controllers all within the class that has your UITabBarController.

Community
  • 1
  • 1
timgcarlson
  • 3,017
  • 25
  • 52