I am getting a lot of data from my server.
To serialize it I use ModelMapper. I have lots of Mappable objects, so I need a function that would be able to map any kind of mappable data. Something like this:
func serializeData(of type: Mappable.Type) -> [Mappable]? {
return try? response?.map(to: [type].self)
}
My issue is that map(:) method requires [Mappable].Type as input. [type].self however is [Mappable.Type]. I am getting lost here. Please help