Rotate animation (iOS 4 above)

Takefumi Katsuren 7th of March 2012

- (void)rotateViewWithAnimation:(UIView*)inView duration:(float)inDuration delay:(float)inDelay anglesInDegree:(float)inAngles
{
  [UIView animateWithDuration:inDuration
                                        delay:inDelay
                                     options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction
                               animations:^{
                                 float radians = inAngles * M_PI / 180.0f;
                                 [inView setTransform:CGAffineTransformMakeRotation(radians)];
                               }
                               completion:^(BOOL)finished {
                                 // Something to do when finish animations.
                               }];
}
402
Views
0
Comments
4
Downloads
Comments
Only Code Pad members can post comments!

Want to join Code Pad Request An Invite
    No Comments Posted

Suppo - Create, Customize & Host
Your App Support Page at Suppo

Snippet Details

Keyboard Shortcuts

DDownload

TTweet

FFull View

Next Snippet

Previous Snippet