I understand this question is many times on STackOverflow and also many on internet too. I have also asked question related to be same, but the context is different, so please bear with me as I am not able to find the solution for this task.
I am using Xcode 5, using Storyboard. MY project is Tab based and have added a LoginViewController in the storyboard. My win is to show LoginViewController prior to Tabs. I tried several ways from various sites, but nothing works fully. With this code, I could get the LoginViewController at first, but not able to get Tabs controller. In my AppDelegate :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil];
self.tabBarController = [[MC_MainTabBarController alloc] init];
LoginViewController *loginViewController = [storyboard instantiateViewControllerWithIdentifier:@"loginViewController"];
[self.window setRootViewController:loginViewController];
// This also works - it shows the login
//[[[[UIApplication sharedApplication] delegate] window] setRootViewController:loginViewController];
// With this Login doesn't come only
//[loginViewController setModalPresentationStyle:UIModalPresentationFullScreen];
//[tabCtrler presentViewController:loginViewController animated:NO completion:nil];
return YES;
}
In my LoginViewController.m - on loginBtnClicked event in end, I call :
NSLog(@"Showing TabController");
MC_AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate.window setRootViewController:appDelegate.tabBarController];
On execution of the above lines, I get black screen and following warning :
Showing TabController
Two-stage rotation animation is deprecated. This application should use the smoother single-stage animation.
Two-stage rotation animation is deprecated. This application should use the smoother single-stage animation.
Can anyone please help me out. I am stuck on this problem from last 2 days.
Any help is highly appreciated.