KeyValueStorage.swift 386 B

12345678910
  1. import Foundation
  2. protocol KeyValueStorage: AnyObject {
  3. func getValue<T: Codable>(_: T.Type, forKey key: String) -> T?
  4. func getValue<T: Codable>(_: T.Type, forKey key: String, defaultValue: T?, reportError: Bool) -> T?
  5. func setValue<T: Codable>(_ maybeValue: T?, forKey key: String)
  6. func setValue<T: Codable>(_ maybeValue: T?, forKey key: String, reportError: Bool)
  7. }