Created
June 29, 2018 14:45
-
-
Save onurgenes/e4560d55ddb8b13adecc38af31a5a02d to your computer and use it in GitHub Desktop.
SecondViewController
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
| // | |
| // SecondViewController.swift | |
| // learnherotransitions | |
| // | |
| // Created by Onur Geneş on 29.06.2018. | |
| // Copyright © 2018 Onur Geneş. All rights reserved. | |
| // | |
| import UIKit | |
| import Stevia | |
| import Hero | |
| class SecondViewController: UIViewController { | |
| lazy var greenView: UIView = { | |
| let v = UIView() | |
| v.backgroundColor = .green | |
| return v | |
| }() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| self.hero.isEnabled = true | |
| greenView.hero.id = "greenView" | |
| view.backgroundColor = .blue | |
| greenView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(popVC))) | |
| view.sv( | |
| greenView | |
| ) | |
| greenView.height(150).width(150).centerHorizontally().centerVertically(300) | |
| } | |
| @objc func popVC() { | |
| self.navigationController?.popViewController(animated: true) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment