Pichi
This is yet another look on the problem of mapping JSON to your app's model objects. It uses different ideas from
Implementation details
Map
The root part of this library is Map protocol. It declares high level abstraction over JSON. This protocol allows to:
- access children through
subscript - returns current JSON raw value with
value<T>()method There are also two groups of operators (forJSONBasicConvertableandTransformTypeprotocols) which allows to interact withMapprotocol.
FromJSONMap
Implementation of Map protocol based on struct which allows transform raw JSON to your model objects using <-> operators
ToJSONMap
Implementation of Map protocol based on class which allows transform objects to JSON with <-> operators.
JSONBasicConvertable
This protocol is used for simple swift's data types (Int, String, Bool etc.)
TransformType
This protocol is used for tranforming to/from JSON of more complex objects (NSDate, arrays, dictionarys)