Skip to content

Instantly share code, notes, and snippets.

@onurgenes
Created June 29, 2018 14:45
Show Gist options
  • Select an option

  • Save onurgenes/e4560d55ddb8b13adecc38af31a5a02d to your computer and use it in GitHub Desktop.

Select an option

Save onurgenes/e4560d55ddb8b13adecc38af31a5a02d to your computer and use it in GitHub Desktop.
SecondViewController
//
// 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