I have an app using a tab bar and, when the app loads, I expose a login view controller to authenticate the user:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
initialScreenViewController = [[Login alloc] init];
[window addSubview:tabBarController.view];
[window addSubview:initialScreenViewController.view];
[window makeKeyAndVisible];
return YES;
When the user successfully authenticates, I hide the login view to expose the tab bar view:
[self.view removeFromSuperview];
My question is this….I have a log out button in the app. When that button is pressed, how do I essentially expose the login screen again and block the tab view?
Thank you!
Jason
The same way you did the first time:
Although it might be a little more straightforward to use
presentModalViewController:animated:to display it on top of the tab bar controller.