0

Is there a way to load an image from an URL and write it directly to the disk cache (without presenting them to an UIImageView), so that I can emulate eager loading?

Problems emanate from the need to present 100+ images 4MB each (can't resize them any lower); so we decided to just download all of them into the disk cache, displaying a progress bar to the user, and presenting them after all are in the disk cache.

Any solution that uses Hanake to emulate eager loading will do.

Tom Knapen
  • 2,277
  • 16
  • 31
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206

1 Answers1

0

Could you download and save it in a NSCache so do something like

let cache = NSCache()
cache.setObject(image, forKey: theURLYouDownloadedFrom)
mathielo
  • 6,725
  • 7
  • 50
  • 63
aahrens
  • 5,522
  • 7
  • 39
  • 63