iOS Open Source : Asynchronous Image Downloading with HJCache

Chances are you’ve run into a situation where you would like to have images download in the background – a common example is a tableview that displays both text and images on the same row. As you scroll down the table, images are downloaded in the background and appear as they become available.

Mark Johnson reached out to let me know about an open source library he has written, HJCache, that manages background loading of images. The project offers a range of features, a few are listed below:

  • Cache images on device
  • An image can be used in multiple locations in an app
  • Only download images that are visible on the screen
  • Preload images

There is a nice demo application included with the project that demonstrates how to use the library. A screenshot below shows how the background loading of images looks in the demo application.

HJCache Information and Code

You can read more about how HJCache works by visiting Mark’s blog: HJCache: iPhone cache library for asynchronous image loading and caching.

The source code for the project is hosted here: HJCache