License MIT
Platforms ios 8.0

Swift 2.1
Platforms iOS
License MIT

FTWCache is a small utility library to support caching data locally so we can pull them when we need them. The original repo is written in objective-c by @khanlou. So I want to port the code to swift 2 and support to install the library via CocoaPods.


FTWCache has two class methods for setting and retrieving data:

class func setObject(data: NSData, forKey key:String)


class func objectForKey(key: String) -> NSData?

and you can reset the cache with

class func resetCache()

It stores the files in your Caches folder in its own folder. The default expiration time is 7 days, but you can modify that if you need.

It takes NSData objects, so anything you can format in that way (audio files, images, simple text) can be store in the cache. Note also that the system will also periodically flush the Caches folders of apps if it finds it needs more space.


FTWCache is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "FTWCache"


Kiet Nguyen – iOS blogger at


FTWCache is released under the MIT license. See

Latest podspec

    "name": "FTWCache",
    "version": "",
    "summary": "Dead simple caching for Mac and iOS.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Kiet Nguyen": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": ""
    "source_files": "FTWCache/*"

Pin It on Pinterest

Share This