dduan / TOMLDecoder

From TOML to Swift Codable types.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TOMLDecoder

Amazon Linux 2
CentOS 7
macOS
Ubuntu Bionic
Ubuntu Focal
Windows

TOML parser for your Swift Codables.

struct Team: Codable {
    struct Player: Codable {
        let id: String
        let health: Int
        let joinDate: Date
    }

    let players: [Player]
}

let team = try TOMLDecoder().decode(Team.self, from: tomlData)

TOMLDecoder has a relatively simple set of APIs. Learn more in the introduction.

Installation

With SwiftPM

.package(url: "https://github.com/dduan/TOMLDecoder", from: "0.2.2")

License

MIT. See LICENSE.md.

About

From TOML to Swift Codable types.

License:MIT License


Languages

Language:Swift 80.2%Language:C 19.2%Language:Nix 0.3%Language:Shell 0.2%Language:Makefile 0.1%