Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hero makes my CAEmitterLayer work inconsistently #716

Open
jeromescheer opened this issue Mar 17, 2021 · 5 comments
Open

Hero makes my CAEmitterLayer work inconsistently #716

jeromescheer opened this issue Mar 17, 2021 · 5 comments

Comments

@jeromescheer
Copy link

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

  • Hero Version: 1.6.1

  • iOS Version(s): 14.4

  • Swift Version: 5.3

  • Devices/Simulators: All

  • Reproducible in Examples? (Yes/No): Yes

Demo Project

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

caemitterlayerbug.zip

@JoeMatt JoeMatt self-assigned this Mar 24, 2021
@JoeMatt JoeMatt added this to the 1.7.0 milestone Mar 24, 2021
@JoeMatt JoeMatt added the bug? label Mar 24, 2021
@heysaik
Copy link

heysaik commented Apr 8, 2021

I have the same bug as well

@Macmee
Copy link

Macmee commented Aug 11, 2021

Same!

@JoeMatt
Copy link
Collaborator

JoeMatt commented Aug 13, 2021

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
Copy link

ibrahimyilmaz7 commented Dec 19, 2021

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
Copy link
Collaborator

JoeMatt commented Dec 23, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants