rocket101 rocket101 - 8 months ago 33
Swift Question

Changing text of UIButton programatically swift

Simple question here. I have a UIButton, currencySelector, and I want to programatically change the text. Here's what I have:

currencySelector.text = "foobar"

XCode gives me the error "Expected Declaration". What am I doing wrong, and how can I make the button's text change?

button.setTitle("Button Title", forState: UIControlState.Normal)