0

How to handle multiple textfields in a single row and also having one or more same type of cell which generates single cell per click on an outer button anywhere on controller in swift?

Unable to retrieve data from text fields and generate new cell simultaneously leads to crash.

  • 1
    Please explain your setup. 'multiple textfields in a single row': are they in a cell ? What is the problem for handling them ? Is it 'Unable to retrieve data from text fields and generate new cell simultaneously' ? Explain exactly what you want to do. You also say: 'one or more same type of cell which generates single cell per click'. Explain and possibly post your present code. – claude31 Aug 17 '19 at 10:28
  • First of all thanks for your valuable support @claude31.Let me explain you, actually I have 4 textfields in a cell (i.e. 2 in a single line). And, I have have to generate a new cell as earlier(This part is done).But, I don't know how to get data from each cell's textfields along with this I should be able to generate new cell.If you can clear my concepts about this I would be thankful to you because I have not enough experience. – Ashwani Kumar Aug 18 '19 at 09:54
  • If I understand what you want to do. You have textFields in cells (I name them textField1, txtField2… First, get the cell from the tableView and get the content in car. var txt1: String; var txt2: String if let cell = tableView.cellForRow(at: indexPath) { txt1 = cell.txtField1.text; txt2 = cell.txtField2.text} – claude31 Aug 18 '19 at 11:31
  • @claude31 What if you have enormous number of textfields and these textfields are generating dynamically and cells can be removed along with text fields as well? – Ashwani Kumar Aug 26 '19 at 12:53
  • Enormous: how many ? If enormous, may be you should rethink the design ? What do you fear ? Performance issue ? – claude31 Aug 26 '19 at 13:08

0 Answers0