ArrowParsable

public protocol ArrowParsable

This is the protocol that makes your swift Models JSON parsable.

A typical implementation would be the following, preferably in an extension called MyModel+JSON to keep things nice and clean :

   //  MyModel+JSON.swift

   import Arrow

   extension MyModel: ArrowParsable {

       mutating func deserialize(json: JSON) {
           myVariable <-- json["jsonProperty"]
           //...
       }
   }
  • Makes sur your models can be constructed with an empty constructor.

    Declaration

    Swift

    init()
  • The method you declare your json mapping in.

    Declaration

    Swift

    mutating func deserialize(json: JSON)