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条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注