My code below is trying to add to the score. If the button is pressed the score should go up its not going up. I have added a label and each time the button is pressed nothing is being added to the label. This is in swift 3.
import UIKit
class ViewController: UIViewController {
var score = 0
@IBOutlet var scoreLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
scoreLabel.text = String(score)
}
@IBAction func pressBUTTON(_ sender: Any) {
score += 1
}
}