How to change button text in Swift Xcode 6?

前端 未结 8 818
囚心锁ツ
囚心锁ツ 2021-01-30 03:48

Here\'s what I\'m trying to do. If you\'ve ever played Halo or CoD, you\'d know that you could change the name of a weapon load-out.

What I\'m doing is making it so you

8条回答
  •  别那么骄傲
    2021-01-30 04:18

    In Swift 4 I tried all of this previously, but runs only:

    @IBAction func myButton(sender: AnyObject) {
       sender.setTitle("This is example text one", for:[])
       sender.setTitle("This is example text two", for: .normal)
    }
    

提交回复
热议问题