Cache

3.0.0

nashysolutions/Cache

What's New

Release 3.0.0

2023-02-08T09:57:55Z

See Changelog.

Cache

iOS macOS

Hold values or objects in volatile memory for a pre-determined amount of time.

Usage

Stash a resource against an instance of UUID.

struct TestValue: Identifiable {
    let id: UUID
    let image: UIImage
}
let cache = Cache<TestValue>()
cache.stash(value, duration: .short)

// retrieve using the same `id` value.
let value: TestValue? = cache.resource(for: value.id)

Installation

Use the Swift Package Manager. See Releases.

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Mar 15 2024 05:42:44 GMT-0900 (Hawaii-Aleutian Daylight Time)