HeroTransitions / Hero

Elegant transition library for iOS & tvOS
https://HeroTransitions.github.io/Hero/
MIT License
22.02k stars 1.72k forks source link

Hero makes my CAEmitterLayer work inconsistently #716

Open jeromescheer opened 3 years ago

jeromescheer commented 3 years ago

What did you do?

Hi, many thanks to all the people maintaining the library and providing support ❤️. I use a CAEmitterLayer to make some confettis pop as soon a view is displayed. When Hero is used to transition (with an animation) to the view controller containing the CAEmitterLayer, Confettis will be emitted (that's ok) but when you repeat the process (dismiss the controller then show it again) : Confettis will never be emitted again! TL:DR : As soon as Hero is used to do something in the app, my CAEmitterLayer will work inconsistently.

What did you expect to happen?

The CAEmitterLayer emitting confettis every time the view controller is displayed.

What happened instead?

The CAEmitterLayer will emit confettis the first time the controller is displayed, sometimes the second time and never again!

General Information

Demo Project

Note : If you deactivate the hero navigationAnimationType in the ViewController, everything will work as expected.

caemitterlayerbug.zip

heysaik commented 3 years ago

I have the same bug as well

Macmee commented 3 years ago

Same!

JoeMatt commented 3 years ago

I appreciate the demo project and info.

I'm really busy with other projects, but could totally review a PR if someone wants to look into how to fix this based on the info here, doesn't look too difficult.

ibrahimyilmaz7 commented 2 years ago

I don't have deep knowledge about Core Animation but I had a similar problem which I solved by using:

myLayer.beginTime = 0 // this is also the default value

instead of:

myLayer.beginTime = CACurrentMediaTime()

Probably this will fix your issue too and @JoeMatt might predict something regarding this.

JoeMatt commented 2 years ago

I don't have deep knowledge about Core Animation but I had a similar problem which I solved by using:

myLayer.beginTime = 0 // this is also the default value

instead of:

myLayer.beginTime = CACurrentMediaTime()

Probably this will fix your issue too and @JoeMatt might predict something regarding this.

I've been very negligent on this project. Been working on some of my others.

I'm keeping an eye on my github alerts though. Maybe next week, releasing new versions of other projects today and should free up a little time.