Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perform a segue with NO animation?

Is it possible to perform an iOS segue but with NO animation whatsoever? I haven't found any documentation indicating that it is, but I'd imagine that given the fact that there's an animated:(BOOL)animated property on practically every method in UIKit there must be some way to accomplish this.

We've got a simply UIViewController setup, and when the user presses a UIButton, I'd like to be able to perform the segue but with absolutely no animation. Our existing code looks like this:

func buttonPressed(sender: AnyObject?) {
   self.performSegue("MySegue", sender: nil)
}

I haven't been able to find any way of preventing the Segue from animating, though. Thoughts?

like image 207
Shadowman Avatar asked Sep 23 '14 19:09

Shadowman


2 Answers

you could easily deactivate the Animation in your storyboard:

Sotyboard

like image 124
derdida Avatar answered Nov 02 '22 06:11

derdida


On the button action add the following code:

TryViewController *trypage = [self.storyboard instantiateViewControllerWithIdentifier:@"Try"];
 [self.navigationController pushViewController:trypage animated:NO];

You just need to set the Storyboard ID of the view you want to go. Storyboard ID can be found here: enter image description here

like image 3
LS_ Avatar answered Nov 02 '22 05:11

LS_