I have a UIImageView and four buttons below it. Once the user taps one of the buttons it sets the image in the image view. The problem is I want to add constraints to the images in the image view. I added the images programmatically the code for one of the buttons looks like this:
overridefunc viewDidLoad() {
super.viewDidLoad()
let defaults = UserDefaults.standard
goldImageView.image = UIImage(named: "gold with Text"
}
@IBAction func gold(_ sender: Any) {
goldImageView.image = UIImage(named: "gold with Text")
}