-2
@IBAction func blueBtnAct(_ sender: AnyObject) {
    score++  //error bcause Unary operator '++' cannot be applied to an operand of type '@lvalue Int'
    blueLbl.text = "\(score)"
    GrenLbl.text = "\(score)"
    testScore()
}
@IBAction func GrenBtnAct(_ sender: AnyObject) {
    score--  //error bcause Unary operator '--' cannot be applied to an operand of type '@lvalue Int'
    blueLbl.text = "\(score)"
    GrenLbl.text = "\(score)"
    testScore()
}
David Rönnqvist
  • 56,267
  • 18
  • 167
  • 205
Farras Doko
  • 307
  • 4
  • 11

1 Answers1

6

You should use use score = score + 1 instead of score++

Zee
  • 327
  • 1
  • 8