以前の続き(リンク内容)になるのですがOpenWeatherMapの以下のJSONデータの中にある
{ "coord”:{ “lon":133.93, "lat":34.8 }, "weather":[{"id":801,"main":"Clouds","description":"薄い雲","icon":"02d"}], "base":"stations", "main":{ "temp":11.6, "pressure":1022, "humidity":43, "temp_min":11, "temp_max":12 },
の
"weather":[{"id":801,"main":"Clouds","description":"薄い雲**","icon":"02d"**}],
にあるアイコンのIDは分かったので「image」という変数にアイコンIDを入れました。
let weatherIcon = URL(string: "https://openweathermap.org/w/(image).png")
としましたがこの後どうすればよいのか分かりません。
最終的には、UIImageViewに表示したいです。
回答1件
あなたの回答
tips
プレビュー