ignasi / Busquets

Swift in-memory LRU cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Busquets

CI Status Version License Platform

Simple Swift in-memory LRU cache

Install

CocoaPods

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

pod "Busquets"

Requirements

  • iOS 9.X (iOS 8.X is not tested yet)
  • Swift 2.0

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

let stringCache = Busquets<String>()
stringCache.set("nickname", value: "ushisantoasobu")
print(stringCache.get("nickname"))

let intCache = Busquets<Int>()
intCache.set("age", value: 31)
print(intCache.get("age"))

get

get(key :String) -> AnyObject?

set

set(key :String, value :AnyObject) -> Bool

hasValue

hasValue(key :String) -> Bool

getCapacity

getCapacity() -> Int

getCount

getCount() -> Int

getKeys

getKeys() -> Array<String>

getValues

getValues() -> Array<AnyObject>

remove

remove(key :String)

removeAll

removeAll()

Author

ushisantoasobu, babblemann.shunsee@gmail.com

License

Busquets is available under the MIT license. See the LICENSE file for more info.

About

Swift in-memory LRU cache

License:MIT License


Languages

Language:Swift 86.9%Language:Ruby 10.1%Language:Objective-C 3.0%