Home > DeveloperSection > Forums > How to set UIButton state in iOS
marcel ethan
marcel ethan

Total Post:105

Posted on    December-19-2015 12:04 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 616  View(s)
Rate this:
I have created a UIButton on our iPhone app, now I want to manually change the button state.
I read the UIButton documentation but I can't seem to find anything about manually setting a UIButton state.
Any help would be appreciated.

Tarun Kumar

Total Post:214

Posted on    January-07-2016 2:20 AM

We can set UIButton state by mannually.
use code like this:
UIButton *myButton=[UIButton buttonWithType : UIButtonTypeCustom];
if(myButton isselected])
Now, we can do operation on UIButton as requirement, like executing some action when button is selected and while not selected.

Don't want to miss updates? Please click the below button!

Follow MindStick