Skip to content

Instantly share code, notes, and snippets.

@metin-atalay
Last active March 20, 2022 14:03
Show Gist options
  • Save metin-atalay/dd1d3b07e79d006479490d9f385c71e0 to your computer and use it in GitHub Desktop.
Save metin-atalay/dd1d3b07e79d006479490d9f385c71e0 to your computer and use it in GitHub Desktop.
import Foundation
import ObjectMapper
struct WeatherModel : Mappable {
var coord : Coord?
var weather : [Weather]?
var base : String?
var main : Main?
var visibility : Int?
var wind : Wind?
var clouds : Clouds?
var dt : Int?
var sys : Sys?
var timezone : Int?
var id : Int?
var name : String?
var cod : Int?
init?(map: Map) {
}
mutating func mapping(map: Map) {
coord <- map["coord"]
weather <- map["weather"]
base <- map["base"]
main <- map["main"]
visibility <- map["visibility"]
wind <- map["wind"]
clouds <- map["clouds"]
dt <- map["dt"]
sys <- map["sys"]
timezone <- map["timezone"]
id <- map["id"]
name <- map["name"]
cod <- map["cod"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment