You would need to declare a separated class for the location to contain the lat and the lng properties:
class Location: Mappable {
var lat: Double?
var lng: Double?
required init?(map: Map){ }
func mapping(map: Map) {
lat <- map["lat"]
lng <- map["lng"]
}
}
thus you could use it as:
class Base: Mappable {
var location: Location?
// ...
required init?(map: Map){ }
func mapping(map: Map) {
location <- map["location"]
//...
}
}
It would represent a nested type for mapping the base object.
Aside bar note: you might also want to check Codable - Encoding and Decoding Custom Types.