title: Update tableview row label from another tableview selected row in swift
body: <p>I have stuck up with an issue where I have a <code>UITableView</code> with a label and button in each row when the button is clicked from a particular row it will navigate to the next view and it has <code>UITableView</code> with a country list, when selected the country it will popup to the previous view and I want to update the country name with selected row, Could someone guide me how to update it. Below is my code. TIA</p>
  <p>FirstViewController.swift</p>
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: &quot;CustomCell&quot;, for: indexPath) as! CustomTableCell
              
      let dict = customData[indexPath.row]  as? NSObject
      cell.lblTitle.text = &quot;Title&quot;
      // cell.lblSubTitle.text = &quot;&quot;
      
      cell.selectedButton.tag = indexPath.row
      cell.selectedButton.addTarget(self, action: #selector(buttonClick), for: .touchUpInside)
      
      return cell
  }
      
  @objc func buttonClick(sender: UIButton){
      let customCell = CountryViewController(nibName: nil, bundle: nil)
      self.navigationController?.pushViewController(customCell, animated: true)  
  }
  </code></pre>
  <p>CountryViewController.swift</p>
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: &quot;CountryCell&quot;, for: indexPath) as! CountryTableCell
      
      cell.lblTitle.text = CountryList[indexPath.row]
      
      return cell
  }
      
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
       let selectedCountry = CountryList[indexPath.row]
       self.navigationController?.popViewController(animated: true)
  }
  </code></pre>