-
Notifications
You must be signed in to change notification settings - Fork 19
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
If you go to another screen, and then return, the animation will be stopped! #4
Comments
Hi @Krusheuski, thanks for the bug report. I'll take a look at this when I get some time. |
I've also come across this issue. It seems like what happens is that when the view is off screen but still retained in memory, the CAAnimations get removed, so the isAnimating property is out of sync. The state issue could be solved by returning isAnimating dynamically based on the presence of the animation keys. I haven't found a workaround inside the spinner component itself, but in my view controller I am iterating through all the spinners and calling startAnimating() again. There is a slight side effect however, which is that it starts at the first color rather than the current color. @justindhill it would be nice if we could get startAnimating() to continue from the current state (rotation and color) |
Hey @pixelmatrix, those are both great ideas. Resuming from the last color is very easy and I have some ideas about how I could accomplish resuming the rotation from the existing state. Could you please file that as a separate ticket? |
Also @pixelmatrix I was thinking the ideal solution would be to actually resume animating when the view is re-added to a window. It seems more in-line with the intent of the API consumer. |
@pixelmatrix My indicators are in the cells. And now I have to reload the table cells after returning to the screen to start startAnimation. :( |
Hey @Krusheuski - I just pushed up v1.3.1 to CocoaPods this morning. It should fix the immediate problem of the spinner being out of sync with the isAnimating property. DRPLoadingSpinner now simply starts the animation again when it is re-added to the window. For the moment, it does not resume the state of the animation that it had when it was removed from the window, but I will work on this when I get some time. I am also open to PRs that address the problem. |
@justindhill thx |
Looks like @pixelmatrix opened another issue for resuming from the spinner's prior state, so I'm going to close this one as the immediate problem is solved. We can continue discussion in #5 |
If you go to another screen, and then return, the animation will be stopped, although isAnimating == yes.
The text was updated successfully, but these errors were encountered: