In order to achieve what you want, ie, they donβt see the first viewController at all, you need to remove the animation during the transition. Without animation, the user will see that the first visual was shown first.
You can achieve this in many ways. One of them (assuming it is modal) will create a new segue in the storyboard, with a different identifier and without animation, and call it if your condition is true.
It will be something like this:
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; NSString *user = [prefs stringForKey:@"userName"]; if(user.length>0){ NSLog(@"Going straight to main %s", "Yes"); [self performSegueWithIdentifier:@"startMain-noAnimation" sender:self]; } }
source share