iosswiftimage-cachingalamofireimagediskcache

How is Alamofireimage saving the image to disk cache?


I am trying to find out if it's possible to force an image to be saved on disk with Alamofireimage. Looking at the source code, I cannot locate where it is actually saving the image to the disk. Does anyone know?


Solution

  • It is possible to save the response for the image request on disk. You can init the ImageDownloader with a modified configuration with your desired NSURLCache and set it also as the UIImageView.af_sharedImageDownloader. Here I've posted an example method for that.