How to change the text on a Button

- by

You can set the title of a button depending on its control state. An unselected untoched button has a UIControlStateNormal, but Xcode will show you all the other options you have at your fingertips.

To access this property you need to create an IBOutlet on the button. If you also want the button to trigger an action you also have to define an IBAction.

[self.myButtonLabel setTitle:@"Your text here" forState:UIControlStateNormal];


If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.