Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source iOS Library Providing Simple And Flexible Memory, Disk Or SQLite Database Based Caching


I’ve mentioned a number of libraries for easier caching of assets, most recently the Swift based background image downloading library with built in caching called Skeets.

Here’s an easy to use caching library called CacheKit from David Beck that allows you to specify which objects are to be cached, and provides options for caching to memory, to disk or to a SQLite database.

Some of the features of CacheKit include:

Syntax similar to NSMutableDictionary or Cache
Expiration time support
Memory, Disk, SQLite caching
Error checking in case the object does not exist (such as if it was removed due to a memory warning)

For the caching to work your objects simple need to conform to NSCoding.

This code example from the readme shows how to save an object to CacheKit with expiration:

[cache setObject:@1 forKey:@"A" expiresIn:30.0];
[cache objectForKey:@"A"]; // returns @1
// 31 seconds later...
[cache objectForKey:@"A"]; // returns nil

You can find CacheKit on Github here.

A nice library for easy cache implementation.


Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.