SDWebImageManager加载本地映像

时间:2014-08-08 15:15:05

标签: xcode sdwebimage

如何SDWebImageManager加载本地图像?

- (id<SDWebImageOperation>)downloadWithURL:(NSURL *)url
                               options:(SDWebImageOptions)options
                              progress:(SDWebImageDownloaderProgressBlock)progressBlock
                             completed:(SDWebImageCompletedWithFinishedBlock)completedBlock;


url NSURL * @"file://localhost/var/mobile/Applications/9BEC6D75-D655-4FC0-814C-ADC084270B27/Documents/Issues/de.20140808.SV.AA/full/articles/img/var/mobile/Applications/9BEC6D75-D655-4FC0-814C-ADC084270B27/Documents/Issues/de.20140808.SV.AA/full/articles/img/20140808001028882_2879337411704403.jpg"

谢谢。

1 个答案:

答案 0 :(得分:0)

您想要SDImageCache

用法: let image = SDImageCache.shared.imageFromCache(forKey: url)

如果需要,您可以指定内存或磁盘缓存,但是默认情况下,它将尝试内存缓存并回退到磁盘。