dimanche 1 février 2015

Swift, Change UIButton color, by tag value

Im trying to change a UIButtons color, using tag value, I have 2 different codes, but none of them works.



self.view.viewWithTag(Int(buttonNumber))?.backgroundColor = UIColor.blueColor()




var tempButton = self.view.viewWithTag(Int(buttonNumber)) as? UIButton

tempButton?.backgroundColor = UIColor.blueColor()


None of theese works, and i can't find out how to solve this




Aucun commentaire:

Enregistrer un commentaire