Ok, I got this issue: I have an application with a login screen that is suposed to show everytime the app goes to background and return. The problem is, the previous screen appears for a fraction of second after the app return to foreground, because the system only refresh what is being seen after loading. What is need is a complete transition before the app returns to foreground. Yes, I am doing the transition on app delegate, at applicationDidEnterBackground. tried at every single other back/fore transition method, same results. The code works fine, but theres a flash of the screen before the login screen showing up.
The full code is as follows:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
if (!([LogicCore loadPass] == nil || [[LogicCore loadPass] isEqualToString:@""])) //a password is set,
{
[self.window.rootViewController dismissModalViewControllerAnimated:YES];//go back to the rootview, the login screen
}
}
Try making the call in
applicationWillEnterForeground:which “lets you know that your app is moving out of the background and back into the foreground, but that it is not yet active.”You’re doing it after the transition has occurred (the change will be “queued” to happen after displaying the view)—you want to do it before, so you go with the
willmethods.