ios - UISwitch decides if another UITableViewCell is editable -
i have 3 custom table view cell in 1 section. first cell have uiswtich. want when uiswitch on other 2 table view cell's uitextfield editable, otherwise not.  possible?
you can adding listener switch, check state, , set editability of 2 text fields there:
// goes viewdidload sw.addtarget(self, action: selector("statechanged:"), forcontrolevents: uicontrolevents.valuechanged)  // function work func statechanged(switchstate: uiswitch) {     if switchstate.on {         textfield1.editable = true         textfield2.editable = true     } else {         textfield1.editable = false         textfield2.editable = false     } } i assuming textfield1 , textfield2 outlets referencing uitextfields in 2 table cells.
Comments
Post a Comment