How do I set the state of of UIButton ?
In the UIButton class reference there is a "state" but it is only "readonly".
Thanks James
You can set selected
property for example
buttton.selected = YES;
Also enabled
and highlighted
properties are available.
Note that all these properties set a bit mask on control's state which you can get using read-only state
property.
myButton.highlighted = YES/NO;
myButton.selected = YES/NO;
myButton.enabled = YES/NO;
These are defined on UIButton's
ancestor UIControl
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With