Latest 0.5.3
License MIT
Platforms ios 8.0, requires ARC

Carthage Compatibility

Lily is a lightweight swift cache framework.


  • With Lily, cache can be done in ease.
  • Lily provide both memory and disk level cache with same sytax.



In your Podfile (note that it require CocoaPods 0.36 or later):

source ''
platform :ios, '8.0'

pod 'Lily'


Carthage is a decentralized dependency manager for Cocoa application.

To integrate Lily into your Xcode project using CocoaPods, specify it in your Cartfile:

github "kukushi/Lily"


It is not recommended to install the framework manually, but if you prefer not to use either of the aforementioned dependency managers, you can integrate Lily into your project manually. A regular way to use Lily in your project would be using Embedded Framework.

  • Add Lily as a submodule. In your favorite terminal, cd into your top-level project directory, and entering the following command:
$ git submodule add
  • Open the Lily folder, and drag Lily.xcodeproj into the file navigator of your app project, under your app project.
  • In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
  • In the tab bar at the top of that window, open the "Build Phases" panel.
  • Expand the "Target Dependencies" group, and add Lily.framework.
  • Click on the + button at the top left of tdemohe panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add Lily.framework.



MemoryCache cache in the memory level. When the App is terminated, all is gone.

// Save integer 1 with key "poi" in the default context using the memory cache
MemoryCache["poi"] = 1

// Retrive the content with key "poi" in the default context from the memory cache
let poi = MemoryCache["poi"].intValue

// If you want to do something in other context, just add other key.

// Save string "hey" with "poi" key in the "You" context
MemoryCache["poi", "You"] = "hey"

// retrive the content of "poi" key in the "You" context
let poiYou = MemoryCache["poi", "You"].stringValue

Cache Types

MemoryCache do it’s work on the memory level. When the App is terminated, all the content will be removed.

QuickCache is base on MemoryCache. It’ll write all the content into disk in the right time at a whole.

DiskCache is base on MemoryCache, too. It do the disk level cache every time you modify content for a key.


  • iOS 8.0 or later
  • Xcode 7.0 or later


Lily is released under the MIT license. See LICENSE for details.


Latest podspec

    "name": "Lily",
    "version": "0.5.3",
    "summary": "A lightweight Swift Cache",
    "description": "Lily provide swifty way API for lightweight data cache.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Xing He": ""
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "0.5.3"
    "source_files": [
    "exclude_files": "Classes/Exclude",
    "requires_arc": true

Pin It on Pinterest

Share This