title: Swift button callback in tableview cell not working
body: <p>I want to have a <code>UIButton</code> inside my <code>TableViewCell</code> and I tried it with a <code>closure</code> but it is not doing anything:</p>
  <p><strong><code>Cell</code>:</strong></p>
  <pre><code>let favouriteButton: UIButton = {
      let v = UIButton()
      v.setImage(UIImage(systemName: &quot;star&quot;), for: .normal)
      v.setImageTintColor(.darkCustom)
      v.addTarget(self, action: #selector(favouriteButtonTapped), for: .touchUpInside)
      v.imageView?.contentMode = .scaleAspectFit
      v.contentHorizontalAlignment = .fill
      v.contentVerticalAlignment = .fill
      v.translatesAutoresizingMaskIntoConstraints = false
      return v
  }()
  
  var favouriteButtonTappedCallback: (() -&gt; ())?
  
  @objc func favouriteButtonTapped() {
      self.favouriteButtonTappedCallback?()
  }
  </code></pre>
  <p><strong><code>CellForRowAt:</code></strong></p>
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: SearchBarCell.reuseID) as! SearchBarCell
      
      cell.favouriteButtonTappedCallback = {
          print(&quot;tapped&quot;)
      }
      return cell
  }
  </code></pre>
  <p>What am I missing here?</p>