IStorage
interface for your objects
- Codable support
- User defaults implementation included
Install with SPM ๐ฆ
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)
This project is released under the MIT license.