Last active
June 6, 2019 01:47
-
-
Save brunomunizaf/88383cf062c54ee3178a99fc9fd4fd2c to your computer and use it in GitHub Desktop.
AnimatedTransitioning
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
| class ViewController: UIViewController { | |
| @IBOutlet weak var imageView: UIImageView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(tappedImage)) | |
| imageView.isUserInteractionEnabled = true | |
| imageView.addGestureRecognizer(tapRecognizer) | |
| } | |
| @objc func tappedImage() { | |
| let transitionAnimator = TransitionDelegate() | |
| navigationController?.delegate = transitionAnimator | |
| let otherVC = OtherViewController(nibName: String(describing: OtherViewController.self), bundle: Bundle.main) | |
| navigationController?.pushViewController(otherVC, animated: true) | |
| } | |
| } | |
| // MARK: - AnimatedTransition | |
| extension ViewController: AnimatedTransition { | |
| func imageView(for transition: TransitionDelegate) -> UIImageView? { | |
| return imageView | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment