Set title

suggest change

titleString and controlState must already exist. These Swift calls are Swift 2.

Swift

button.setTitle(titleString, forState: controlState)

Objective C

[button setTitle:titleString forState:controlState];

To set the default title to “Hello, World!”

Swift

button.setTitle("Hello, World!", forState: .normal)

Objective C

[button setTitle:@"Hello, World!" forState:UIControlStateNormal];

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents