Skip to content

Instantly share code, notes, and snippets.

@gavi
Created July 15, 2017 16:57
Show Gist options
  • Save gavi/40a825e897f03f8a57772491556a2b72 to your computer and use it in GitHub Desktop.
Save gavi/40a825e897f03f8a57772491556a2b72 to your computer and use it in GitHub Desktop.
CodingKeys Enum for renaming JSON keys
struct GeocodingResult:Codable{
struct Geometry:Codable{
struct Location:Codable{
let lat:Float
let lng:Float
}
let location:Location
}
let formattedAddress:String
let geometry:Geometry
private enum CodingKeys: String, CodingKey {
case formattedAddress = "formatted_address"
case geometry
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment