title: UITableView Checkbox ( Select a button when another button is pressed )
body: <p>I have a button called <strong>btnChk2</strong> . I want when the user press the <strong>btnChk2</strong> that the button <strong>btnChk</strong> get selected. Here is my code what happens in my code is that when <strong>btnChk2</strong> is pressed <strong>btnChk2</strong> get selected and not <strong>btnChk</strong>. </p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
      let cell = tableView.dequeueReusableCell(withIdentifier: "CheckBoxCell")
  
      if let lbl = cell?.contentView.viewWithTag(1) as? UILabel {
          lbl.text = "item-\(1)"
      }
  
      if let btnChk = cell?.contentView.viewWithTag(2) as? UIButton {
          btnChk.addTarget(self, action: #selector(checkboxClicked(_ :)), for: .touchUpInside)
      }
  
      if let btnChk2 = cell?.contentView.viewWithTag(100) as? UIButton {
          btnChk2.addTarget(self, action: #selector(checkboxClicked(_ :)), for: .touchUpInside)
      }
  
      return cell!
  }
  
  @objc func checkboxClicked(_ sender: UIButton) {
      sender.isSelected = !sender.isSelected
  }
  </code></pre>