14

Haneke is a lightweight generic cache for iOS written in Swift. For example, here’s how you would initialize a data cache:

let cache = Cache("my-files")

Haneke also includes a zero-config image cache with automatic resizing. It resizes images and caches the result on memory and disk. Everything is done in background, allowing for fast, responsive scrolling. Asking Haneke to load, resize, cache and display an appropriately sized image is as simple as:

imageView.hnk_setImageFromURL(url)

It’s designed to be super-simple to use. Here’s how you would initalize a JSON cache and fetch objects from a url:

let cache = Cache(name: "github")
let URL = NSURL(string: "https://api.github.com/users/haneke")

cache.fetch(URL: URL).onSuccess { JSON in
   println(JSON.dictionary?["bio"])
}

Check out HanekeSwift on GitHub.