Using AlamofireImage and ANWCacheManager, you can cache images while downloading images. You do not need to download the same picture over and over again during the cache age. Easy to use.
To use the AlamofireImageCache in an app, install AlamofireImage and just drag the AlamofireImageCache files in Classes folder (demo files and assets are not needed) into your project. ( https://github.com/Alamofire/AlamofireImage ). Add "#import <CommonCrypto/CommonCrypto.h>" into Bridging-Header.
The AlamofireImageCache has the following properties (note: for iOS, UIImageView when using properties):
var isImageLoading: Bool
Image loading flag.
The AlamofireImageCache has the following methods (note: for iOS, UIImageView in method arguments):
func setImage(urlString: String?, closure: LoadImageClosure? = nil)
Image loading method with url string and complition block. (Use AlamofireImage for image loading. When finished loading, cached image.)
imageView.setImage(urlString: "http://static2.bergfex.com/images/downsized/12/e185569f232e7012_8317a8e7573a6a43.jpg")
Build and run the project files. Enjoy more examples!