SDWebImage下载图片资源管理
/** 下载图片 */
[[SDWebImageManager sharedManager]downloadImageWithURL:[NSURL URLWithString:imageUrl] options:SDWebImageRetryFailed | SDWebImageLowPriority progress:^(NSInteger receivedSize, NSInteger expectedSize) {
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
// 压缩图片尺寸
UIImage *imgs = [UIImage imageByScalingAndCroppingForSize:CGSizeMake(80, 80) withImg:image];
[message setThumbImage:imgs];
WXWebpageObject *ext = [WXWebpageObject object];
ext.webpageUrl = url;
message.mediaObject = ext;
SendMessageToWXReq* req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = scene;
[WXApi sendReq:req];
}];