I have a UIButton, and I’d like to update its title, but I’d rather not have to always do it for each and every state like the following:
[myButton setTitle:@"Play" forState:UIControlStateNormal];
[myButton setTitle:@"Play" forState:UIControlStateHighlighted];
[myButton setTitle:@"Play" forState:UIControlStateSelected];
Is there a better way?
According to the documentation you should only need to call:
In Objective-C:
In Swift:
The UIButton docs explain why:
Namely, that if you only set the normal value the other states will refer to it when being set.