Swiftpack.co -  EthanLipnik/Sebu as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
EthanLipnik/Sebu
Easy caching for codable objects
.package(url: "https://github.com/EthanLipnik/Sebu.git", from: "1.0.3")

Sebu

Easy caching for codable objects.

How does it store?

Sebu uses JSON to store objects in the app's cache directory.

Usage

Save

Save object

let tweets = [Tweet()] // Your own object(s)
try Sebu.default.save(tweets,
              withName: "homeTimeline") // Your own cache name (overwrites by default)

Save object with expiration

try Sebu.default.save(tweets,
              withName: "homeTimeline",
              expiration: Calendar.current.date(byAdding: .minute, value: 5, to: Date())) // Expires in 5 minutes from now

Get

if let cache: [Tweet] = try? Sebu.default.get(withName: "homeTimeline") {
  self.tweets = cache
}

Clear cache

All cache

Sebu.default.clearAll()

Clear certain object

Sebu.default.clear("homeTimeline")

GitHub

link
Stars: 0
Last commit: 2 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.

Related Packages

Release Notes

1.0.0
7 weeks ago

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