struct Weather: Codable { let id: Int let main: MainEnum let weatherDescription: Description let icon: String enum CodingKeys: String, CodingKey { case id, main case weatherDescription = "description" case icon } } enum MainEnum: String, Codable { case clear = "Clear" case clouds = "Clouds" case snow = "Snow" } enum Description: String, Codable { case brokenClouds = "broken clouds" case clearSky = "clear sky" case fewClouds = "few clouds" case lightSnow = "light snow" case overcastClouds = "overcast clouds" case scatteredClouds = "scattered clouds" }
Обсуждают сегодня