Skip to content

Instantly share code, notes, and snippets.

@steipete
Created September 13, 2011 09:48
Show Gist options
  • Save steipete/1213499 to your computer and use it in GitHub Desktop.
Save steipete/1213499 to your computer and use it in GitHub Desktop.
- (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