Swiftpack.co -  obrhoff/SwimplyCache as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
LRU Cache written in Swift.
.package(url: "https://github.com/obrhoff/SwimplyCache.git", from: "1.0.3")


What is this?

SwimplyCache is a simple, threadsafe caching solution. It is internally backed by a LinkedHashMap and very fast compared to NSCache.

SwimplyCache will automatically empty itself in the event of a memory warning or a app background event.


Create the Cache

 let cache = SwimplyCache<String, String>()

Add Value

cache.setValue("Value", forKey: "Key")
cache.setValue("Value", forKey: "Key", costs: 200)

Retrieve Value

let value = cache.value(forKey: "Key")

Remove Value

Swimply allows you to remove values by following operations.

cache.remove(.key(key: "Key"))
cache.remove(.byLimit(countLimit: 200))
cache.remove(.byCost(costLimit: 200))


Stars: 2
Last commit: 39 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API