title: how to perform specific action at certain table view row in swift?
body: <p><a href="https://i.stack.imgur.com/QpT52.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QpT52.png" alt="enter image description here"></a></p>
  
  <p>I have a table view cell. I make an app for a tenant in the apartment to report the defect of the room facility. if the defect has been repaired (status: Complete), data from server will give defect.status == 2 (if defect.status == 1, still on process to be repaired), and it will show YES and NO Button like the picture above.</p>
  
  <p>I want if it still on the repairment process, the view that contains "Are You satisfied" label and Yes No Button will not appear. The expected result should be like the picture below</p>
  
  <p><a href="https://i.stack.imgur.com/1MhMK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1MhMK.png" alt="enter image description here"></a></p>
  
  <p>here is the code I use to remove that satisfied or not view</p>
  
  <pre><code>extension RequestDefectVC : UITableViewDataSource {
  
       //MARK: Table View Delegate &amp; Datasource
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return listDefects.count
      }
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "defectCell", for: indexPath) as! RequestDefectCell
  
          let dataDefect = listDefects[indexPath.row]
          cell.defectData = dataDefect
  
          if dataDefect.status == 2 {
              if let wantToRemoveView = cell.commentResponseView {
                  wantToRemoveView.removeFromSuperview()
              }
          }
  
  
          return cell
      }
  
  }
  </code></pre>
  
  <p>but unfortunately, if that <code>wantToRemoveView.removeFromSuperview()</code> is triggered, it will remove all the view in all cell, even though the status is completed like picture below</p>
  
  <p><a href="https://i.stack.imgur.com/zsP6E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zsP6E.png" alt="enter image description here"></a></p>
  
  <p>I want that <code>satisfied or not view</code> appears if the status is complete, otherwise, it will be removed. how to do that ?</p>