Latest 0.9.4
Homepage https://github.com/swhitty/DictionaryDecoder
License zlib
Platforms ios 9.0, tvos 9.0, osx 10.10

Travis
CodeCov
Swift 4.2
License
Twitter

A Swift library for serializing Codable types to and from [String: Any] and UserDefaults.

Usage

struct Person: Codable {
   var name: String
   var age: Int
}

let person = try DictionaryDecoder().decode(Person.self, from: [
   "name": "Herbert",
   "age": 99
   ])

UserDefaults

Store and retrieve any Codable type within UserDefaults.

let person = Person(name: "Herbert", age: 99)

//persist values
try UserDefaults.standard.encode(person, forKey: "owner")

//retrieve values
let owner = try UserDefaults.standard.decode(Person.self, forKey: "owner")

Latest podspec

{
    "name": "DictionaryDecoder",
    "version": "0.9.4",
    "summary": "A Swift library for encoding and decoding Codable types to [String: Any].",
    "homepage": "https://github.com/swhitty/DictionaryDecoder",
    "authors": "Simon Whitty",
    "license": {
        "type": "zlib",
        "file": "LICENSE.txt"
    },
    "source": {
        "git": "https://github.com/swhitty/DictionaryDecoder.git",
        "tag": "0.9.4"
    },
    "platforms": {
        "ios": "9.0",
        "tvos": "9.0",
        "osx": "10.10"
    },
    "source_files": "Sources/*.swift",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This