Skip to content

Instantly share code, notes, and snippets.

@objectiveSee
Created May 21, 2013 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save objectiveSee/5618142 to your computer and use it in GitHub Desktop.
Save objectiveSee/5618142 to your computer and use it in GitHub Desktop.
// TODO: Use weak self to avoid retaining self for a long time (during long downloads)
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadWithURL:imageURL
options:0
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished)
{
if ( [self.imageURL isEqual:imageURL] &&
image &&
!error )
{
[self setAvatarImage:image];
}
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment