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

Pulsing animation removed after bringing app back to the foreground #16

Closed
ddewaele opened this issue Apr 12, 2015 · 6 comments
Closed

Comments

@ddewaele
Copy link

When the demo app is running and the home button is pressed, the app is pushed to the background.
When the app is launched again. the pulsing animation is gone.

What would be the correct hook to bring the animation back on the screen ?

@unmutedev
Copy link

For us we see it going away even when you present a view controller over a view controller that has a pulsing halo. Would love an explanation on this!

@ddewaele
Copy link
Author

@unmute I have a simple app where a new viewcontroller is pushed onto the stack via a navigation controller, and the pulsing halo (placed on the first viewcontroller) was also shown on the second viewcontroller. I thought this was normal behaviour.

I had to remove it by executing the following code :

[self.halo removeAllAnimations];
[self.halo removeFromSuperlayer];

@unmutedev
Copy link

In the latest version there was an addition starting on line 105 in PulsionHaloLayer.m of the CAAnimationGroup delegate method. This method seems to be called when pushing a view controller or presenting one which in turn removes the animation. I added the if (flag) then remove the animations as that signals the animation is truly done. I am unsure if this is correct but for now until I revisit the code it will have to do. Below is my code for that method which would not remove the animation when a view controller is pushed or presented.

  • (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
    if (flag)
    {
    [self removeAllAnimations];
    [self removeFromSuperlayer];
    }
    }

@goelv
Copy link

goelv commented Apr 27, 2015

@unmute thanks a lot for your suggestion. I experienced the exact same issue as you and your suggestion about has helped me fix it.

@genaks
Copy link

genaks commented May 30, 2016

Does not work for me

@shu223
Copy link
Owner

shu223 commented May 30, 2016

I created updated version named "Pulsator" which is written in Swift.

https://github.com/shu223/Pulsator

This problem has been fixed at the repo. Usage is almost same.

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

No branches or pull requests

5 participants