Disabling segue animation

codeDude picture codeDude · Oct 15, 2015 · Viewed 10.9k times · Source

I want to Show (e.g. push) segues in my storyboard, to connect my viewcontrollers and my navigation controller. Then the navigation bars on the viewcontrollers will show correctly. For example: With show detail or present modaly, the navigation bar will disappear

But I don't want segue animation. Xcode is giving the warning like : "Disabling segue animation is not available prior to iOS 9.0"

And I wants deployment target of iOS 7.0 or 8.0

How can I solve this?

Thanks in advance.

Answer

Arbitur picture Arbitur · Oct 15, 2015

You can disable animations before performing the segue and after enable it again.

UIView.setAnimationsEnabled(false)
self.performSegueWithIdentifier("next", sender: nil)
UIView.setAnimationsEnabled(true)

This will perform the segue without the animation.