How to change UIButton image in Swift

前端 未结 12 1337
猫巷女王i
猫巷女王i 2020-12-01 00:25

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:[         


        
12条回答
  •  一生所求
    2020-12-01 00:52

    As of swift 3.0 .normal state has been removed.you can use following to apply normal state.

    myButton.setTitle("myTitle", for: [])
    

提交回复
热议问题