Skip to content

Instantly share code, notes, and snippets.

@davo

davo/switch.swift

Created Nov 6, 2015
Embed
What would you like to do?
Switch for ranges in Swift.
switch temperatura {
case -20...20:
toColors = [ UIColor(rgba: "#4355D7").CGColor, UIColor(rgba: "#D930B9").CGColor]
default:
toColors = [ UIColor(rgba: "#1804D2").CGColor, UIColor(rgba: "#0091FF").CGColor]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment