title: Animate selected row on button tap
body: <p>I currently have a table with a custom cell that contains a button and a label. Everything is working fine, the label displays the product name and the button responds to a button tap.</p>
  
  <p>What I would like to be able to do is animate the width of the row/cell where the button was tapped.</p>
  
  <p>Here is the code I currently have...</p>
  
  <p><strong>Main ViewController:</strong></p>
  
  <pre><code>class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate{
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
          let cell = tableView.dequeueReusableCell(withIdentifier: "reusableCell", for: indexPath) as! CustomCell
  
          let data = items[indexPath.row]
  
          cell.displayProductName.text = data.productName
  
          cell.buttonAction = { sender in
              print("Button tapped...")
          }
  
          return cell
      }
  }
  </code></pre>
  
  <p><strong>Custom Cell</strong></p>
  
  <pre><code>class CustomCell: UITableViewCell {
      var buttonAction: ((UIButton) -&gt; Void)?
  
      override func awakeFromNib() {
          super.awakeFromNib()
      }
  
      override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
      }
  
      @IBAction func activeInactive(_ sender: UIButton) {
          self.buttonAction?(sender)
      }
  }
  </code></pre>
  
  <p><strong>Table View</strong></p>
  
  <p><a href="https://i.stack.imgur.com/7SrYR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7SrYR.png" alt="enter image description here"></a></p>
  
  <p>How can I animate the width of the row where the button was tapped?</p>