How to change UIButton image after clicking in Swift?

后端 未结 5 1824
夕颜
夕颜 2020-12-10 08:18

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

5条回答
  •  感情败类
    2020-12-10 09:21

    Try this code

    let image = UIImage(named: "duellogo.png") as UIImage!
    self.playRoundButton.setImage(image, forState: .Normal)
    

提交回复
热议问题