Change image of a button when clicking it Xcode

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 Soucer file."



Read more here: https://stackoverflow.com/questions/64958100/change-image-of-a-button-when-clicking-it-xcode

Content Attribution

This content was originally published by Hispalis Guadal at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: