TOMLDecoder
从TOML v0.5.0内容中解码您的值。
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)
支持的平台:iOS、Linux、macOS、tvOS和watchOS。
在介绍中了解更多信息。
安装
CocoaPods
使用use_frameworks!
pod "TOMLDecoder"
SwiftPM
使用.package(url: "https://github.com/dduan/TOMLDecoder", from: "0.1.6")
Carthage
使用github "dduan/TOMLDecoder"
许可协议
MIT。查看 LICENSE.md
文件。