Created
February 12, 2016 18:13
-
-
Save mingsai/6a62b245f577a83dae33 to your computer and use it in GitHub Desktop.
A set of Swift classes to disable the automatic animation associated with a segue. One can then add one's custom animation instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ModalNoAnimationSegue.swift | |
| // | |
| // | |
| // Created by Tommie N. Carter, Jr., MBA on 9/2/15. | |
| // Copyright © 2015 MING Technology. All rights reserved. | |
| // | |
| import UIKit | |
| /// Present the next screen without an animation. | |
| class ModalNoAnimationSegue: UIStoryboardSegue { | |
| override func perform() { | |
| self.sourceViewController.presentViewController( | |
| self.destinationViewController as UIViewController, | |
| animated: false, | |
| completion: nil) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // PushNoAnimationSegue.swift | |
| // | |
| // | |
| // Created by Tommie N. Carter, Jr., MBA on 9/2/15. | |
| // Copyright © 2015 MING Technology. All rights reserved. | |
| // | |
| import UIKit | |
| /// Move to the next screen without an animation. | |
| class PushNoAnimationSegue: UIStoryboardSegue { | |
| override func perform() { | |
| let source = sourceViewController as UIViewController | |
| if let navigation = source.navigationController { | |
| navigation.pushViewController(destinationViewController as UIViewController, animated: false) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment