Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Hero framework?

I'm learning to use this popular animation framework on Github: https://github.com/lkzhao/Hero

I built a test project, like this:

enter image description here

This is my ViewController:

class ViewController: UIViewController {

    @IBOutlet weak var animationObject: UIImageView!

    override func viewDidLoad() {
        super.viewDidLoad()

        isHeroEnabled = true
        animationObject.heroModifiers = [.fade, .translate(x:0, y:-250), .rotate(x:-1.6), .scale(1.5)]
    }
}

When I ran the project, the view doesn't move. I have no idea how to make it work from the wiki page of Hero, so is there somebody who can give me a hint?

like image 397
Bright Avatar asked Feb 15 '17 08:02

Bright


1 Answers

Hero is the library for ViewController transition, so you needs at least two ViewController to see transition effect.

like image 177
noob Avatar answered Oct 29 '22 00:10

noob