FilipAndersson245 / BetterWeather

Weather application for iOS in the course iOS development
MIT License
3 stars 0 forks source link

Connect WeatherTypes to icons #21

Closed zimonitrome closed 5 years ago

zimonitrome commented 5 years ago

Find royalty-free icons and create a way to group the WeatherTypes to correct icon (maybe also use in view).

zimonitrome commented 5 years ago
clear
case ClearSky = 1
case NearlyClearSky = 2

halfclear
case VariableCloudiness = 3
case HalfclearSky = 4

cloudy
case CloudySky = 5
case Overcast = 6

fog
case Fog = 7

light rain
case LightRainShowers = 8
case LightRain = 18

moderaterain
case ModerateRainShowers = 9
case ModerateRain = 19

heavy rain
case HeavyRainShowers = 10
case HeavyRain = 20

thunder
case Thunderstorm = 11
case Thunder = 21

sleet
case LightSleetShowers = 12
case ModerateSleetShowers = 13
case HeavySleetShowers = 14
case LightSleet = 22
case ModerateSleet = 23
case HeavySleet = 24

snow
case LightSnowShowers = 15
case ModerateSnowShowers = 16
case HeavySnowShowers = 17
case LightSnowfall = 25
case ModerateSnowfall = 26
case HeavySnowfall = 27
zimonitrome commented 5 years ago

@FilipAndersson245 use this when converting

Used in view as of now together with the new models.

    let weatherImages: [String: [Int]] = [
        "clear": [1,2],
        "half clear": [3,4],
        "cloudy": [5,6],
        "fog": [7],
        "light rain": [8, 18],
        "moderate rain": [9, 19],
        "heavy rain": [10, 20],
        "thunder": [11, 21],
        "sleet": [12, 13, 14, 22, 23, 24],
        "snow": [15, 16, 17, 25, 26, 27]
    ]

    let weatherString = weatherImages
        .filter { $0.1.contains(weatherEnum) }
        .first!.0

I might have goofed and used the numbers when I should have used enums idk hurr durr.

zimonitrome commented 5 years ago

for license: https://www.iconfinder.com/iconsets/weather-color-2

zimonitrome commented 5 years ago

Closing issue, continue integration with the parser if needed.