How to set up pushcontroller animations for No navigation when using storyboards

I am using a storyboard for iphone based navigation app. I want the viewcontrollers to navigate using the "pushviewcontroller" property, but at the same time I don't want them to come to life. I just want to set the Animation property to NO

How to do this using a storyboard?

+6
source share
2 answers

To extend the answer to @azethoth, creating an animation without changes is as simple as:

@interface NoAnimationSegue : UIStoryboardSegue @end @implementation NoAnimationSegue - (void)perform { [[self.sourceViewController navigationController] pushViewController:self.destinationViewController animated:NO]; } @end 
+6
source

As far as I know, this cannot be done declaratively. You either manually call

 [sourceController pushViewController:destination animated:NO]; 

Or, if you use the segue algorithm, you can create your own subclass of UIStoryboardSegue and implement the perform method to do this. Then in the storyboard, you can use Custom segue and enter the name of your subclass of segue.

+2
source

Source: https://habr.com/ru/post/919715/


All Articles