title: Swift 3: how to change the button image in UITableView?
body: <pre><code> func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
     ...
  
   let doLikeBtn = detailCell.contentView.viewWithTag(106) as! UIButton
                  doLikeBtn.setTitle(String(indexPath.row), for: UIControlState.normal)
                  doLikeBtn.addTarget(self, action: #selector(doLike(sender:)), for: UIControlEvents.touchUpInside)
  
  ...
  
   }
  
  ...
  
   func doLike(sender: UIButton) {
          selectUserIndex = sender.title(for: UIControlState.normal)!
  
      if sender.image(for: UIControlState.normal) == UIImage(named: "btn_Like.png") {
          sender.setImage(UIImage(named: "btn_not_Like.png"), for: UIControlState.normal)
      }else {
          sender.setImage(UIImage(named: "btn_Like.png"), for: UIControlState.normal)
      }
   }
  </code></pre>
  
  <p>If I click one button in table, and then change the image of button, but other some button's images also are changed repeatedly.
  I can't understand this.
  Please help me!
  Best regards.</p>