I have a collection view where display weather data for the next four days. In this block
func prepareCollectionViewDataSource() {
var x = self.city?.forecasts
x?.removeFirst()
self.otherDaysForecasts = x
}
This is how x is looking like:
[0] : Forecast
- temperature : 296.84199999999998 { ... }
- maximum : 296.84199999999998 { ... }
- minimum : 296.84199999999998 { ... }
- description : "light rain" { ... }
- icon : "10d" { ... }
- humidity : 92.0 { ... }
- pressure : 1021.4299999999999 { ... }
- wind : 1.8600000000000001 { ... }
- date : 2016-07-18 18:00:00 +0000
I remove the first day and display other four. From JSON I got weather data on every three hours. It's an array and I want to display only one data for each day.
Any suggestion how to do that?