Swift Change UIButton Text

Опубликовано: 12 Июль 2026
на канале: solron75
10,724
43

How to in Swift change UIButton text?
A common mistake, also done by myself some time ago, is to try to change it through an IBAction. You can use an IBAction, but probably not the way you think. A common mistake is to do something like this:
button.text = "Some text"
This will give a compiler error if you try something like that. I would make sense to be able to do it like that. Like in Visual Studio you can change text like that.

For written instructions see this page:
http://soltveit.org/swift-change-uibu...