mardi 24 novembre 2015

How can I remove items from Set when uncheck a checkbox ?

Hi guys. I have a tableView , which has one checkbox and one label in all rows.

So I tagged the checkboxes with labels. The goal is to make a set with clicked checkboxes. But the problem is I've done the checking and adding in set part. But I couldn't do unselecting part. --> I mean if I click the checkbox two times basically I deselect it so I have to remove the item from set, But I could't solve it.

If you can suggest something I ll be appreciated. Thanks.

func yourCheckBoxClicked(cbx:UIButton){

    choosenSet.insert(self.tableData[cbx.tag])// this is the checkbox label which was clicked
    print(choosenSet)

}




Aucun commentaire:

Enregistrer un commentaire