iOS開發(fā)常用的第三方類庫
2
3
[cell.imageView setImageWithURL:[NSURL URLWithString:@http://www.domain.com/path/to/image.jpg]
placeholderImage:[UIImage imageNamed:@placeholder.png]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {... completion code here ...}];
SDWebImage并不局限于UIImageView上,使用SDWebImageManager完成更多的操作:
本文引用地址:http://2s4d.com/article/201610/305920.htm1 2 3 4 5 6 7 8 9 10 11 12 13 14 | SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager downloadWithURL:imageURL options:0 progress:^(NSUInteger receivedSize,long long expectedSize) { // 下載進度 } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) { if (image) { // 下載完成 } }]; |
或者使用Image Downloader也是一樣的效果:
相關(guān)推薦
技術(shù)專區(qū) |
評論