IPhone : Delay in presenting a view controller in iOS 8

on Wednesday, March 25, 2015

When launching the app, I'm presenting a login view controller on the top of the menu controller so that after login is successful, I dismiss the presented login view controller. This worked flawless until iOS 7.


In iOS8, this is not working as expected. First I could see menu controller for a second or so and then the login view controller is presented. Tried many solutions on google & stack overflow, few worked on simulator but nothing worked out on device. Pls help.


[window addSubview:ctl.view]; - Tried this piece of code before presenting the loginviewcontroller. This worked on simulator but not on device.



LoginViewController *ctl = [defaultStoryboard instantiateViewControllerWithIdentifier:@"LoginViewControllerID"];

double delayInSeconds = 0.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after (popTime, dispatch_get_main_queue(), ^(void) {
[ROOT_NAV_CTL presentViewController:ctl animated:animated completion:^{
}];
});

0 comments:

Post a Comment