JSONCop
JSONCop makes it easy to write a simple model layer for your Cocoa and Cocoa Touch application.
JSONCop's APIs are highly inspired by Mantle, you can use similar APIs to generate parsing methods with JSONCop.
let json: [String: Any] = [
"id": 1,
"name": "Draven",
"createdAt": NSTimeIntervalSince1970
]
let person = Person.parse(json: json)
Usage
Define a model with and add //@jsoncop just before model definition line:
//@jsoncop
struct Person {
let id: Int
let name: String
}
Run cop install in project root folder.
$ cop install
This will generate several parsing methods in current file without affecting other part of your codes:

All the code between // MARK: - JSONCop-Start and // MARK: - JSONCop-End and will be replaced when re-run cop install in current project folder. Other codes will remain unchanged. Please don't write any codes in this area.
Installation
sudo gem install jsoncop --verbose
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/draveness/jsoncop. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.