<code>
if (condition < 300) {
if nightTime {
self.icon.image = UIImage(named: "tstorm1_night")
} else {
self.icon.image = UIImage(named: "tstorm1")
}
} else if (condition < 500) {
self.icon.image = UIImage(named: "light_rain")
} else if (condition < 600) {
self.icon.image = UIImage(named: "shower3")
} else if (condition < 700) {
self.icon.image = UIImage(named: "snow4")
} else if (condition < 771) {
if nightTime {
self.icon.image = UIImage(named: "fog_night")
} else {
self.icon.image = UIImage(named: "fog")
}
} else if (condition < 800) {
self.icon.image = UIImage(named: "tstorm3")
} else if (condition == 800) {
if nightTime {
self.icon.image = UIImage(named: "sunny_night")
} else {
self.icon.image = UIImage(named: "sunny")
}
} else if (condition < 804) {
if nightTime {
self.icon.image = UIImage(named: "cloudy2_night")
} else {
self.icon.image = UIImage(named: "cloudy2")
}
} else if (condition == 804) {
self.icon.image = UIImage(named: "overcast")
} else if ((condition >= 900 && condition < 903) || (condition > 904 && condition < 1000)) {
self.icon.image = UIImage(named: "tstrom3")
} else if (condition == 903) {
self.icon.image = UIImage(named: "snow5")
} else if (condition == 904) {
self.icon.image = UIImage(named: "sunny")
} else {
self.icon.image = UIImage(named: "dunno")
}
</code>