@ Martol1ni I wanted to use your answer, but I also wanted to stay away from the unnecessary mess of the storyboard, so I changed your code a bit. However, I gave you +1 for your inspiring answer.
In the default controller, I placed all of the following.
- (void)gotoScreen:(NSString *)theScreen
{
AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
UIViewController *screen = [self.storyboard instantiateViewControllerWithIdentifier:theScreen];
[app.window setRootViewController:screen];
}
And then, when logic happens, I will invoke the following if necessary.
if(myBool == YES) {
[self gotoScreen:@"theIdentifier"];
}
source
share