Last active
December 16, 2015 16:49
-
-
Save lostincode/5465456 to your computer and use it in GitHub Desktop.
AFNetworking fade in on first load only.
This file contains 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
__weak UITableViewCell *weakCell = cell; | |
[cell.imageView setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]] | |
placeholderImage:nil | |
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) { | |
if (response.statusCode == 0) return; | |
weakCell.imageView.alpha = 0; | |
weakCell.imageView.image = image; | |
[UIView animateWithDuration:0.5 | |
delay:0 | |
options:UIViewAnimationCurveEaseIn | |
animations:^{ | |
weakCell.imageView.alpha = 1; | |
} | |
completion:nil]; | |
} 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