[Solved] cannot assign to value ‘colorTouched’ is a ‘let’ constant [closed]
You should be using == for comparison instead of = (which is assignment): @IBAction func buttonTouched(sender : UIButton) { var buttonTag : Int = sender.tag if let colorTouched = ButtonColor(rawValue: buttonTag) { if currentPlayer == .Computer { return } // note double equals if colorTouched == inputs[indexOfNextButtonToTouch] { … 1 solved cannot assign to value … Read more