I am using JSONModel for creation of complex data models. I have recently migrated to swift and face difficulties during parsing an array of custom data models.
class ABCDomain: JSONModel
{
var sampleBool : Bool!
var sampleArray : Array <XYZDomain>!
}
After parsing, when i access the sampleArray i get the message as "fatal error: NSArray element failed to match the Swift Array Element type".
In Objective C, we would be creating a protocol as well for the XYZDomain, while in Swift a compiler error stating redeclaration is thrown. @property (strong, nonatomic) NSArray* sampleArray;
Primitive data type like Bool as well always appears as nil in the datamodel Please let me know if there is any workaround for this.