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

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -