I am using the SDWebImage library to cache web images in my app:
https://github.com/rs/SDWebImage/blob/master/README.md
Current Usage:
You can use options parameter.
Swift version:
imageView.sd_setImage(with: URL(string: URLWithString:profilePictureUrl),
placeholderImage: UIImage(named: "placeholder"),
options: .refreshCached,
completed: nil)
Objective-C version:
[imageView sd_setImageWithURL:[NSURL URLWithString:profilePictureUrl]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]
options:SDWebImageRefreshCached
completed: nil];
Cheers!