Using Almofireimage to download and then cache cell image

时间:2017-06-22 15:25:53

标签: ios swift alamofire alamofireimage

I am currently using Alamofireimage下载图片,我的目标是在完成后对其进行缓存。由于图像是静态的,因此一旦下载,就不需要再次下载它们了。

Alamofireimage文档说,当使用简单的UIImageView扩展名af_setImage时,图像会自动缓存。我的目标是(我无法在文档中找到)是我如何访问此缓存,然后将其永久缓存到应用程序。

1 个答案:

答案 0 :(得分:2)

从第175行的文件中 https://github.com/Alamofire/AlamofireImage/blob/master/Source/UIImageView%2BAlamofireImage.swift

此方法af_setImage将自动查找并加载图像(如果已缓存)。 在此页面中,您可以查看第280行以手动访问缓存。

相关问题