Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS disable push segue animation

I have a storyboard with various segues for pushing ViewControllers in a NavigationController.

In storyboard i disabled Animation:

enter image description here

However the push is still animating. Why?

like image 453
Lord Vermillion Avatar asked Sep 26 '22 07:09

Lord Vermillion


1 Answers

That animation is the default behaviour. You need to create a custom UIStoryBoardSegue like so:

PushNoAnimationSegue.h is:

#import <UIKit/UIKit.h>

@interface PushNoAnimationSegue : UIStoryboardSegue

@end

PushNoAnimationSegue.m is:

#import "PushNoAnimationSegue.h"

@implementation PushNoAnimationSegue

-(void) perform{
    [[[self sourceViewController] navigationController] pushViewController:[self   destinationViewController] animated:NO];
}

@end

For each segue now change the class to this one you just created and choose "custom" in the kind drop down menu.

like image 163
Kex Avatar answered Sep 30 '22 04:09

Kex