title: How to maintain tableview scroll to stop reusing cell
body: <p><a href="https://i.stack.imgur.com/RfKdh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RfKdh.png" alt="enter image description here"></a>I have multiple sections in tableview. I have multiple questions and multiple answers of each question. In multiple answers, I have one option and that is other (option).  when I select the button of other, then it shows the text field for advice. Now i need to maintain the data of text field and that selected option's (Other) text when scrolling in tableview.I am using below code for all answer.</p>
  
  <pre><code>if (indexPath.section == 2)
         {
             let cellidentifier="cell3"
             let cell=tableView.dequeueReusableCell(withIdentifier: cellidentifier,for:indexPath as IndexPath)  as! TextfieldTableViewCell
  
             let object_3:AnswerBaseClass = arrobject_answer[0][indexPath.row]
             //print("arrobject is\(arrobject_answer[0][indexPath.row])")
  
             if object_3.answer == "O"
             {
                    // cell.lbl_answer.isHidden = true
                     cell.btn_selected.isHidden=true
                     //cell.lbl_answer_height.constant = 0
                     cell.Other_textfield.tag = 101
                     cell.Other_textfield.borderStyle = .line
                     cell.Other_textfield_top.constant = -30
                     cell.Height_2.constant = 30
             }
             else
             {
                 cell.lbl_answer?.text = object_3.answer!
                 cell.Other_textfield_top.constant = 12
                 cell.Height_2.constant = 0
                 cell.lbl_answer.isHidden = false
                 cell.btn_selected.isHidden=false
                 if answer_main_data[0][indexPath.row] == true
                 {
                     cell.lbl_answer.tag = indexPath.row
                     cell.btn_selected.isSelected=true
                     if cell.lbl_answer.text == "Other"
                     {
                         for subview in cell.contentView.subviews
                         {
                             subview.removeFromSuperview()
                         }
                         if arrOtherTextfield_2.indices.contains(indexPath.row)
                         {
                             cell.addSubview(arrOtherTextfield_2[indexPath.row])
                         }
                         else
                         {
                             cell.Other_textfield.tag = 1100
                             cell.Other_textfield.borderStyle = .line
                             cell.Height_2.constant = 30
                             arrOtherTextfield_2.append(cell.Other_textfield)
                         }
                     }
                     else
                     {
                         cell.Height_2.constant = 0
                     }
                 }
                 else
                 {
                     cell.Other_textfield_top.constant = 12
                     cell.btn_selected.isSelected=false
                     cell.Height_2.constant = 0
                 }
             }
             cell.Other_textfield.borderStyle = .line
             return cell
         }
  </code></pre>