bithavoc / CodableLocal

Extend UserDefaults to set and get methods that work with any Codable(Encodable & Decodable) conforming types

Repository from Github https://github.combithavoc/CodableLocalRepository from Github https://github.combithavoc/CodableLocal

CodableLocal

Version License Platform

Example

UserDefaults+Codable

struct UserInfo : Codable {
  let userId: String
}

...

let defaults = UserDefaults.standard
try defaults.set(object: UserInfo(userId: "id1"), forKey: "current-user")
let info = try defaults.get(objectType: UserInfo.self, forKey: "current-user")

Requirements

  • Swift 5 or above

Installation

CodableLocal is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CodableLocal'

Author

bithavoc, im@bithavoc.io

License

CodableLocal is available under the MIT license. See the LICENSE file for more info.

About

Extend UserDefaults to set and get methods that work with any Codable(Encodable & Decodable) conforming types

License:MIT License


Languages

Language:Ruby 54.6%Language:Swift 45.4%