title: How to show custom view in UITableviewCell when button pressed?
body: <p>I've recently started to learn iOS development and I ran into some problems.</p>
  
  <p>I have a tableview with custom cell: Label, image view (hidden by default) and a button.
  I want it to work so that when the button is clicked for the cell the image view gets shown.
  The problem is that every time the cell is reused the image view is shown for the reused cell.
  I want to get it to work so that if the button is pressed for the first cell, ONLY the first cells image view is shown. If the button for first and third cell is pressed the image view should show ONLY for first and third row and not any other row.</p>
  
  <p>My current solution:</p>
  
  <pre><code>class CustomTableViewCell: UITableViewCell {
  
      @IBOutlet var cellTitleLabel: UILabel!
      @IBOutlet var cellImageView: UIImageView!
      var showImageView = false
  
  
      @IBAction func showImageViewAction(sender: UIButton) {
          showImageView = true
          displayCell()
      }
  
      func displayCell() {
          if showImageView {
              cellImageView.hidden = false
          } else {
              cellImageView.hidden = true
          }
      }
  }
  </code></pre>
  
  <p>And for the view controller:</p>
  
  <pre><code>func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return 30
  }
  
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCellWithIdentifier("CustomCell", forIndexPath: indexPath) as! CustomTableViewCell
  
      return cell
  }
  
  func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
      let customCell = cell as! CustomTableViewCell
      customCell.displayCell()
  }
  </code></pre>
  
  <p>Any suggestions on how to create so that the image view gets hidden when the cell is reused?</p>