VCDefaultsStorage

User defaults storage with Codable support

Installation

Install with SPM 📦

Usage

enum Key: IObjectKey, String {
    case bar
}

struct SomeData: Codable {
    let foo: String
}

let storage = DefaultsStorage(UserDefaults.standard)

let dataToSave = SomeData(foo: "🤓")
storage.save(data, for: Key.bar)

let fetchedData: SomeData?  = self.storage.fetch(for: Key.bar)

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Oct 20 2024 15:39:05 GMT-0900 (Hawaii-Aleutian Daylight Time)