Created
July 15, 2013 03:56
-
-
Save patsch/5997409 to your computer and use it in GitHub Desktop.
iOS table view cell animation
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
// with animation: | |
NSURLRequest *ur = [NSURLRequest requestWithURL:imageURL]; | |
// to fade the image in automatically when it's loaded: | |
// http://stackoverflow.com/questions/13974226/afnetworking-fade-animation-on-image-while-scrolling-uitableview | |
[cell.imageView setImageWithURLRequest:ur placeholderImage:[UIImage imageNamed:@"placeholder.png"] success:^(NSURLRequest *request , NSHTTPURLResponse *response , UIImage *image ){ | |
if (request) { | |
//Fade animation | |
[UIView transitionWithView:cell.imageView | |
duration:1.0f | |
options:UIViewAnimationOptionTransitionCrossDissolve | |
animations:^{[cell.imageView setImage:image];} | |
completion:NULL]; | |
} | |
} | |
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error){ | |
}]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment