TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by Xing He.
Lily is a lightweight swift cache framework.
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.
cd
into your top-level project directory, and entering the following command:$ git submodule add https://github.com/kukushi/Lily.git
Lily
folder, and drag Lily.xcodeproj
into the file navigator of your app project, under your app project.Lily.framework
.+
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
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.
Lily is released under the MIT license. See LICENSE for details.