-
-
Save dropocol/f095f7665d76433b13d32df9d3e66808 to your computer and use it in GitHub Desktop.
Revisions
-
Daemon-Devarshi created this gist
Oct 27, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ protocol Pop { func moveBackToParentViewController(currentViewController: UIViewController) } extension Pop { func moveBackToParentViewController(currentViewController: UIViewController) { let transition = CATransition() transition.duration = 0.5 transition.type = kCATransitionMoveIn transition.subtype = kCATransitionFromLeft currentViewController.view.window!.layer.add(transition, forKey: kCATransition) currentViewController.dismiss(animated: true, 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ import UIKit class Push: UIStoryboardSegue { override func perform() { let transition = CATransition() transition.duration = 0.5 transition.type = kCATransitionPush transition.subtype = kCATransitionFromRight source.view.window!.layer.add(transition, forKey: kCATransition) source.present(destination, 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ class PushedViewController: UIViewController, Pop { @IBAction func backAction(_ sender: AnyObject) { moveBackToParentViewController(currentViewController: self) } }