Search code examples
xcodeanimationsegue

Push segue in xcode with no animation


I am using normal storyboarding and push segues in xcode, but I want to have segues that just appear the next view, not slide the next view (as in when you use a tab bar and the next view just appears).

Is there a nice simple way to have normal push segues just "appear" and not "slide", without needing to add custom segues?

Everything is working completely fine, I just want to remove that slide animation between the views.


Solution

  • I have now managed to do this using the following code:

    CreditsViewController *creditspage = [self.storyboard instantiateViewControllerWithIdentifier:@"Credits"];
    [UIView beginAnimations:@"flipping view" context:nil];
    [UIView setAnimationDuration:0.75];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:YES];
    [self.navigationController pushViewController:creditspage animated:NO];
    [UIView commitAnimations];
    

    Hope this helps someone else!