Created
June 29, 2018 14:18
-
-
Save onurgenes/f5d1ec7987f875ecd72ef5ef61fba0e9 to your computer and use it in GitHub Desktop.
ViewController file of LearnHeroTransition's
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
| // | |
| // ViewController.swift | |
| // learnherotransitions | |
| // | |
| // Created by Onur Geneş on 29.06.2018. | |
| // Copyright © 2018 Onur Geneş. All rights reserved. | |
| // | |
| import UIKit | |
| import Stevia | |
| import Hero | |
| class ViewController: UIViewController { | |
| lazy var greenView: UIView = { | |
| let v = UIView() | |
| v.backgroundColor = .green | |
| return v | |
| }() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| greenView.hero.id = "greenView" | |
| greenView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(openSecondVC))) | |
| view.backgroundColor = .white | |
| view.sv( | |
| greenView | |
| ) | |
| greenView.height(50).width(50).centerInContainer() | |
| } | |
| @objc func openSecondVC() { | |
| let nc = UINavigationController(rootViewController: SecondViewController()) | |
| nc.hero.isEnabled = true | |
| self.navigationController?.pushViewController(SecondViewController(), animated: true) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment