Skip to content

Instantly share code, notes, and snippets.

@davo
Created November 6, 2015 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davo/8e1c2600d43ecc7ed131 to your computer and use it in GitHub Desktop.
Save davo/8e1c2600d43ecc7ed131 to your computer and use it in GitHub Desktop.
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