Modal transition does not occur

How to remove the transition effect from a modal segment when showing a modality as follows:

[self performSegueWithIdentifier:@"SomeIdentifier" sender:self];

I know that I can go into the storyboard and switch between 4 different animations, but I don’t want to! How to remove them?

I know I can say presentModalViewController animated: NO, but I can’t and I can’t name it. I need to use a method performSegueWithIdentifier.

+5
source share
4 answers

You need to make custom segue (without animation) if you need segue but don't want animation.

Apples " segues" , ( ).

+9

, "". .

+15

no-animation segue:

BVNoAnimationSegue.h

#import <UIKit/UIKit.h>
@interface BVNoAnimationSegue : UIStoryboardSegue
@end

BVNoAnimationSegue.m

#import "BVNoAnimationSegue.h"

@implementation BVNoAnimationSegue

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

@end

, (, BVNoAnimationSegue.m/.h), "" Segue BVNoAnimationSegue Segue Class. , Xcode, , , "no animation segue" , CTRL- UIViewControllers .

+11

Another way:

YourViewController *aYourViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"aYourViewControllerIdentifier"];
[self.navigationController pushViewController:aYourViewController animated:NO];

and add @"aYourViewControllerIdentifier"to view the controller in the storyboard.

-1
source

All Articles