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)
{

}
}];

评论

0条评论

发表评论

电子邮件地址不会被公开。