JSONNeverDie is an auto reflection tool from JSON to Model, a user friendly JSON encoder / decoder, aims to never die. Also JSONNeverDie is a very important part of Pitaya.
set up a Model:
class People: JSONNDModel {
@objc var name = ""
}
reflex JSON to Model automatic:
let json = JSONND(string: "{\"name\": \"JohnLui\"}")
let people = People(JSONNDObject: json)
print(people.name)
And JSONNeverDie is well tested.
You are welcome to fork and submit pull requests.
JSONNeverDie is open-sourced software licensed under the MIT license.
构建一个 Model:
class People: JSONNDModel {
@objc var name = ""
}
从字符串转换成 JSON 再自动映射为 Model:
let json = JSONND(string: "{\"name\": \"JohnLui\"}")
let people = People(JSONNDObject: json)
print(people.name)
欢迎提交 issue 和 PR,大门永远向所有人敞开。
本项目遵循 MIT 协议开源,具体请查看根目录下的 LICENSE 文件。