Closed SaifAlDilaimi closed 10 years ago
But if I touch the home button and go back to the App it starts the animation.
The startAnimating
method has a side-effect, which changes the ivar _animating
to the value YES
, when you call it. This is thought, so that the CAAnimation can be re-added after backgrounding indicated by the state of the ivar. This explains this behavior.
So there has to be something, which doesn't alter the state, but removes the spin animation from the layer of the activity indicator view.
Do you have something in place, which could cause that the animation can't be added or is removed?
I'm using facebooks pop framework in the same class. But i'm not sure which could effect that
@deada92 Did you found yourself a solution for this problem? Otherwise I would need further information to help you with this issue.
Unfortunately not, give me today some time. Didn't had time to debug it but I will today!
Fixed it. I have to use the call in main thread:
dispatch_async(dispatch_get_main_queue(), ^{
[self.loadingCircle startAnimating];
});
Damn, what I wrote was working on iOS 8. On iOS 7 its not...
You should always call startAnimating
(and all other UI updates) on main queue.
Can you please provide a minimal example to reproduce this issue?
I fixed it. I had network traffic to my server in a background traffic. I did this to work on both OS:
dispatch_async(dispatch_get_main_queue(), ^{
[self.loadingCircle startAnimating];
});
self.imageViewDelegate ? [self.imageViewDelegate didStartUploadingImage:self] : @"";
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Network traffic
});
Hello Guys,
I got a issue over here. I have added a MRActivityIndicatorView and called the startAnimating method. The View is visible but its not rotating. It's just like this:
But if I touch the home button and go back to the App it starts the animation.