Skip to content

Instantly share code, notes, and snippets.

@jimcervone
Created July 25, 2013 13:47
Show Gist options
  • Select an option

  • Save jimcervone/6079798 to your computer and use it in GitHub Desktop.

Select an option

Save jimcervone/6079798 to your computer and use it in GitHub Desktop.
Switch Navigation Stack (Useful for Login)
- (void)replaceNavigationStack
{
FirstViewController *vc1 = [[FirstViewController alloc] init];
SecondViewController *vc2 = [[SecondViewController alloc] init];
ThirdViewControler *vc3 = [[ThirdViewController alloc] init];
NSArray *newViewControllers = [[NSArray alloc] initWithObjects:vc1, vc2, vc3, nil];
[[self navigationController] pushViewContrller:vc3 animated:YES];
[[self navigationController] setViewControllers:newViewControllers];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment