I am using SDWebImage library to load remote images into a table view which uses a custom cell class i have created. I simply use
[cell.imageView setImageWit
I met the same problem,I found UIImageView+WebCache cancel last download when a new download come.
I not sure whether this is the intention of the author. So I write a new category of UIImageView base on SDWebImage.
Easy to use:
[cell.imageView mq_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
groupIdentifier:@"customGroupID"
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
}];
To view more: ImageDownloadGroup
Advanced usage:
// create customGroup
MQImageDownloadGroup *customGroup = [[MQImageDownloadGroup alloc] initWithGroupIdentifier:@"tableViewCellGroup"];
customGroup.maxConcurrentDownloads = 99;
// add to MQImageDownloadGroupManage
[[MQImageDownloadGroupManage shareInstance] addGroup:customGroup];
// use download group
[cell.imageView mq_setImageWithURL:@"https://xxx"
groupIdentifier:@"tableViewCellGroup"
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
}];