用于 Swift Codable
的 TOML 解析器。
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 拥有相对简单的 API 集合。 在简介中了解更多信息。
.package(url: "https://github.com/dduan/TOMLDecoder", from: "0.3.1")
MIT 许可。 参见 LICENSE.md
。