I'm new in ios development. I'm using wheel images in my project.The animation is working fine in foreground mode. After that I pressed the home button.now i relaunch the app the wheel animation is not working. this is my code:
CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; animation.fromValue = [NSNumber numberWithFloat:0.0f];
animation.toValue = [NSNumber numberWithFloat: 2*M_PI];
animation.duration = 1.0f;
animation.repeatCount = INFINITY;
[imageLeft.layer addAnimation:animation forKey:@"SpinAnimation"];
Ah I figured it out - use this and all the cases like stopping after going into the background will be fixed.
animation.isRemovedOnCompletion = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With