sdwebimage 4.0升级5.0
原 UIImage *cachedImage = [[SDWebImageManager sharedManager].imageCache imageFromDiskCacheForKey:customMessageModel.icon];
新
SDImageCache* cache = [SDImageCache sharedImageCache];
UIImage *cachedImage = [cache imageFromDiskCacheForKey:customMessageModel.icon];
原
[[SDWebImageManager sharedManager].imageDownloader downloadImageWithURL:[NSURL URLWithString:customMessageModel.icon] options:SDWebImageDownloaderLowPriority progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
}];
新
[[SDWebImageDownloader sharedDownloader] downloadImageWithURL:[NSURL URLWithString:customMessageModel.icon] completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if(error)
{
}
}];
发表回复