Set title
suggest changetitleString 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];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents