Adding circular rotation animation to a UIView or UIimageView in ios

– (void)animateImageViewRight:(UIImageView *)imageView {
CABasicAnimation *fullRotation;
fullRotation = [CABasicAnimation animationWithKeyPath:@”transform.rotation”];
//fullRotation.fromValue = [NSNumber numberWithFloat:0];
fullRotation.fromValue = [NSNumber numberWithFloat:0];
fullRotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
fullRotation.duration = 99.0f;
fullRotation.removedOnCompletion = NO;
fullRotation.fillMode = kCAFillModeForwards;
fullRotation.repeatCount = MAXFLOAT;
[imageView.layer addAnimation:fullRotation forKey:@”360″];
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s