How to handle CheckBox event in Swift

A very simple checkbox control.

 @IBAction func btn_box(sender: UIButton) {
        if (btn_box.selected == true)
        {
            btn_box.setBackgroundImage(UIImage(named: "box"), forState: UIControlState.Normal)
            
                btn_box.selected = false;
        }
        else
        {
            btn_box.setBackgroundImage(UIImage(named: "checkBox"), forState: UIControlState.Normal)
            
            btn_box.selected = true;
        }
    }


How to handle CheckBox event in Swift How to handle CheckBox event in Swift Reviewed by Edmond Legaspi on Wednesday, October 08, 2014 Rating: 5

No comments:

Powered by Blogger.