Skip to content

Instantly share code, notes, and snippets.

@pawurb
Created November 8, 2014 19:01
Show Gist options
  • Save pawurb/8a1cba564cca81ac6a23 to your computer and use it in GitHub Desktop.
Save pawurb/8a1cba564cca81ac6a23 to your computer and use it in GitHub Desktop.
colors changer
let colors = [UIColor.turquoiseColor(),
UIColor.greenSeaColor(),
UIColor.emerlandColor(),
UIColor.nephritisColor(),
UIColor.peterRiverColor(),
UIColor.belizeHoleColor(),
UIColor.amethystColor(),
UIColor.wisteriaColor(),
UIColor.midnightBlueColor(),
UIColor.sunflowerColor(),
UIColor.tangerineColor(),
UIColor.carrotColor(),
UIColor.pumpkinColor(),
UIColor.alizarinColor(),
UIColor.pomegranateColor(),
UIColor.cloudsColor(),
UIColor.silverColor(),
UIColor.concreteColor(),
UIColor.asbestosColor()]
override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
self.view.backgroundColor = colors[index]
println(index)
index++
if(index == 20) {
index = 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment