Skip to content

nashysolutions/Cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages