- (void)rotateViewWithAnimation:(UIView*)inView duration:(float)inDuration anglesInDegree:(float)inAngles
{
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationDuration:inDuration];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(endAnimation)];
float radians = inAngles * M_PI / 180.0f;
[inView setTransform:CGAffineTransformMakeRotation(radians)];
[UIView commitAnimations];
}
- (void)endAnimation
{
// Something to do when finish animations.
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.