i have this animation on the first view controller of a tabbarviewcontroller
- (void)viewDidAppear:(BOOL)animated
{
[UIView animateWithDuration:4.0 delay:0.0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear animations:^{
CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI);
self.rotatingImage.transform = transform;
} completion:NULL];
}
it works nicely but when i change viewcontroller from the tabbar and return to the first viewcontroller animation is stopped.
There is a similar thread iOS UIView Animation Issue but there isn’t any kind of explanation
Try this out:
The explanation is simple… while the animation code is being fired again, the transform of the UIImageView is already equal to the final transform of the animation. This would be similar of animating the alpha of the UIImageView from 1.0 to 1.0 — nothing changes.