SDWebImageManager加载本地图像

问题描述 投票:1回答:1

如何使用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"

谢谢。

xcode sdwebimage
1个回答
0
投票

您想要SDImageCache

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

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

© www.soinside.com 2019 - 2024. All rights reserved.