From DarkSky to WeatherKit, summary and icon fields

Hello,

I'm migrating my app to use WeatherKit from Dark Sky, and although most of the data fields is transformable, there are a few that are missing from WeatherKit's response; for example, summary and icon for daily/hourly/current weather data blocks.

I'm curious, what workarounds have people used for these fields that can bridge that gap? My app relies on these values to render icons.

Thank you!

Answered by in 746535022

The conditionCode field in the daily, hourly, and current weather response can be used to select an icon representing the weather expected in the period. If your choice of icon differs based on the time of day (such as showing a moon at night vs a sun during the day) you can also incorporate the daylight boolean to determine whether the period in question is during the day or night.

Accepted Answer

The conditionCode field in the daily, hourly, and current weather response can be used to select an icon representing the weather expected in the period. If your choice of icon differs based on the time of day (such as showing a moon at night vs a sun during the day) you can also incorporate the daylight boolean to determine whether the period in question is during the day or night.

Thank you. Where can I find the list of all possible enums for conditionCode?

The enum values are the same for the REST API as for the Swift framework: https://developer.apple.com/documentation/weatherkit/weathercondition

@bdesai, did you ever find a substitue for DarkSky's summary? I'm missing it too.

@Skyla157, unfortunately, I did not. I will post here if I do

From DarkSky to WeatherKit, summary and icon fields
 
 
Q