I have an ios5 application developed using a storyboard that currently displays a view of the tab bar controller on first run. I would like to display the login screen until the tab bar controller is displayed. The user enters his username and password, then the system will authenticate the user, and then, if successful, displays the tab bar controller.
I tried the following 3 options with no luck .. any ideas?
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Option 1 UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; PointsViewController *firstVC = [[tabBarController viewControllers] objectAtIndex:0]; UIViewController *loginViewController = [[LoginViewController alloc] init]; [firstVC.navigationController pushViewController:loginViewController animated:YES]; // Option 2 UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UIViewController *loginViewController = [[LoginViewController alloc] init]; [tabBarController presentViewController:loginViewController animated:NO completion:nil]; // Option 3 UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UIViewController *loginViewController = [[LoginViewController alloc] init]; [tabBarController presentModalViewController:loginViewController animated:NO]; return YES; }
abu.marcose
source share