I am trying to change the the image of a button when i click it and I’m using the method below:
@IBOutlet weak var firstCard1: UIButton!
@IBAction func firstCard(_ sender: UIButton) {
let blueCard = UIImage(named: "blue_back")
firstCard1.setImage(blueCard, for: .normal)
}
I get an error on line 4 on the
for: .normal
It says
Editor placeholder in source file.
2
Answers
Clean and then build the project, which can be done with the following keyboard shortcuts:
⌘ command + shift + K then ⌘ command + shift + B
Either delete the line of code and re write it or clean and build your project