Click on New Project & choose View-Based Application Project template.
Enter the name of Project & save it. (for example, CheckBox)
Goto CheckboxViewController.h and implement the code as follows. ( Here, we have mentioned the name of project as CheckBox, so view controller name is CheckBoxViewController )
@interface CheckBoxViewController : UIViewController
Open CheckBoxViewController.m and implement the code as follows.
[(UIButton*)sender setSelected:![(UIButton*)sender isSelected]];
Open CheckboxViewController.xib and Add following things as shown in following figure.
– A Label
– A Button
Give Me the Code.
Here is the source code for it.