I am trying to change the image of a UIButton using Swift... What should I do
This is OBJ-C code.but I don\'t know with Swift:
[playButton setImage:[
I prefer the method of initializing my variables at the top first:
let playButton:UIButton!
var image:UIImage!
and then setting them in viewDidLoad
override func viewDidLoad {
...
playButton = UIButton(type: .Custom)
imagePlay = UIImage(named:"play.png")
playButton.setImage(imagePlay, forState: .Normal)
}