title: didSelectRowAt is not getting called
body: <p>I have a tableView, I set the delegate and datasource but when tapping on a cell, the didSelectRowAt function is not getting called.
  This is my code:</p>
  
  <pre><code>private let reuseIdentifier = "DropdownCell"
  
  extension ReportVC: UITableViewDelegate, UITableViewDataSource {
  
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return showMenu ? companies.count : .zero //If show menu is true the tableView needs to be shown, so we are returning the number of companies in the array, if the show menu is flase the tableView does NOT needs to be shown, so we are returning zero.
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) as! CompanyCell
      cell.companyNameLabel.text = companies[indexPath.row]
  
      let bgColorView = UIView()
      bgColorView.backgroundColor = UIColor.appBlueAccent
  
      cell.selectedBackgroundView = bgColorView
  
      return cell
  }
  
  //TODO: add arrow to indicate the dropdown list, adjust the select company label to the side of the screen
  func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? {
      let button = UIButton(type: .system)
      button.setTitle("Select Company", for: .normal)
      button.setTitleColor(UIColor.appWhite, for: .normal)
      button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 14)
      button.addTarget(self, action: #selector(handleDropDown), for: .touchUpInside)
      button.backgroundColor = UIColor.appBlueAccent
  
      return button
  }
  
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
      print(indexPath.row)
  }
  
  func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -&gt; CGFloat {
      return 50
  }
  
  func configureTableView(){
      tableView = UITableView()
      tableView.translatesAutoresizingMaskIntoConstraints = false
      tableView.isScrollEnabled = false
      tableView.rowHeight = 50
      tableView.separatorStyle = .none
      tableView.backgroundColor = UIColor.appWhite
      tableView.delegate = self
      tableView.dataSource = self
  
      tableView.register(CompanyCell.self, forCellReuseIdentifier: reuseIdentifier)
  
      view.addSubview(tableView)
      NSLayoutConstraint.activate([
          tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 0),
          tableView.leftAnchor.constraint(equalTo: view.leftAnchor),
          tableView.rightAnchor.constraint(equalTo: view.rightAnchor),
          tableView.heightAnchor.constraint(equalToConstant: 250),
  
          ])
  }
  
  
  @objc func handleDropDown(){
  
      showMenu = !showMenu
      var indexPaths = [IndexPath]()
  
      for i in 0..&lt;companies.count{
          let indexPath = IndexPath(row: i, section: 0)
          indexPaths.append(indexPath)
      }
  
      if showMenu {
          tableView.insertRows(at: indexPaths, with: .automatic)
      }else{
          tableView.deleteRows(at: indexPaths, with: .automatic)
      }
  
  }
  }
  </code></pre>
  
  <p>This is my extension of my ReportVC, In the report VC I'm calling configureTableView and set the showMenu and tableView variables.
  I tried to print the indexPath or actually just even print a string to see if the didSelectRowAt is getting called, but nothing happens.</p>