Guest User

OrangeLoops

a guest
Oct 31st, 2019
5,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.77 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController {
  4.   @IBOutlet weak var olImageView: UIImageView!
  5.  
  6.   override func viewDidLoad() {
  7.     super.viewDidLoad()
  8.    
  9.     // Enable Hero for transitions
  10.     navigationController?.hero.isEnabled = true
  11.  
  12.     // Define the transition type for present new screens
  13.     navigationController?.hero.navigationAnimationType = .fade
  14.  
  15.     // Set an id to the OrangeLoops Image View
  16.     olImageView.hero.id = "OrangeLoops-Logo"
  17.   }
  18.  
  19.   @IBAction func navigateToSecondViewController(_ sender: Any) {
  20.     if let viewController =
  21.       self.storyboard?.instantiateViewController(identifier: "SecondViewController") as? SecondViewController {
  22.       navigationController?.pushViewController(viewController, animated: true)
  23.     }
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment