SDWebImageManager *manager = [SDWebImageManager sharedManager];
// 判断是否有缓存
[manager diskImageExistsForURL:imageUrl completion:^(BOOL isInCache) {
UIImage * image;
if (isInCache) {
image = [[manager imageCache] imageFromDiskCacheForKey:imageUrl.absoluteString];
// NSLog(@"有缓存");
}else{
// NSLog(@"没缓存");
NSData *data = [NSData dataWithContentsOfURL:imageUrl];
image = [UIImage imageWithData:data];
}
CGSize gsize = image.size;
// NSLog(@"image 宽%g 高%g isInCache %d",gsize.width,gsize.height,isInCache);
}];