TRON v0.2.0 Release Notes

  • โž• Add support for any custom mapper to be used with TRON. Defaulting to SwiftyJSON.

    Examples:

    Argo, ObjectMapper

    Limitations

    ๐Ÿ“œ ResponseParseable and JSONDecodable are now Self-requirement protocols with all their limitations. Apart from that, there are some other limitations as well:

    Subclasses

    ๐Ÿ“œ Subclassing ResponseParseable requires explicit typealias in subclassed model:

    class Ancestor: JSONDecodable {
        required init(json: JSON) {
    
        }
    }
    
    class Sibling: Ancestor {
        typealias ModelType = Sibling
    }
    

    Discussion in mailing Swift mailing lists

    Multiple custom mappers

    ๐Ÿ“œ Current architecture does not support having more than one mapper in your project, because Swift is unable to differentiate between two ResponseParseable extensions on different types.

    Arrays and CollectionTypes

    ๐Ÿ“œ Currently, there's no way to extend CollectionType or Array with JSONDecodable or ResponseParseable protocol, so creating request with ModelType of array(APIRequest<[Foo],Bar>) is not possible.

    Blocking radars: https://www.openradar.me/23433955 https://www.openradar.me/23196859