Friday, February 24, 2017

How to use Hero framework?

Leave a Comment

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?

2 Answers

Answers 1

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

Answers 2

You are running this demo into iphone 7 plus simulator. Inn library there is one note that Hero does not work on iPhone 7 (Plus) Simulators due to an Apple bug. Please use other simulators or a real device when working with Hero.

So please try to run it on different simulators

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment