Created
September 13, 2011 09:48
-
-
Save steipete/1213499 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)animateImageView:(UIImageView *)imageView newImage:(UIImage *)image { | |
// build animation block | |
CATransition *transition = [CATransition animation]; | |
transition.duration = 0.25f; | |
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
transition.type = kCATransitionFade; | |
[imageView.layer addAnimation:transition forKey:@"image"]; | |
// set new image | |
imageView.image = image; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment