I\'m new to coding development so this should be a pretty noob question. But I\'m trying to change the image of my UIButton to an image stored in image.casset \"duellogo\" i
Baically, use the same code you have previously to create an image from the name (rather than just specifying the name):
UIImage(named: @"duellogo")
You can try this code for your image:
self.playRoundButton.image = UIImage(named: "duellogo.png")
Hope this can help you.
Swift 3:
self.addButton.setImage(UIImage(named: "pending"), for: .normal)
If you want to change the Image of a button you first have to go to your Main.storyboard. Then on the right side, you have to select the Attribute Inspector. Under the headline "Button" you can find the field image, there you can select images stored in your Assets.
Try this code
let image = UIImage(named: "duellogo.png") as UIImage!
self.playRoundButton.setImage(image, forState: .Normal)