title: Delete images programmatically by accessing their tag
body: <p><strong>Swift 3 / Xcode 8.3.3</strong></p>
  
  <p>When I click on the screen, an image appears <strong>(code 1)</strong> at the place of the click (if I click 5 times, 5 images appear) and each image has a tag. Now I would like to delete the images one by one at each click on a button <strong>(code 2)</strong> but only the last image is deleted...</p>
  
  <p>I did a lot of research but none of the results worked for me.</p>
  
  <p><strong>code 1:</strong></p>
  
  <pre><code>        var imageView : UIImageView!
          var lstTagImage: [Int] = []
          var concatenateInt: String = ""
          var lstPoint: [Point] = []
  
          concatenateInt = "\(Int(i))\(Int(j))"
          lstPoint.append(Point(x: i, y: j, weigth: weigthChip))
  
          imageView  = UIImageView(frame:CGRect(x: X,
                                                y: Y,
                                                width: 20, height: 20));
  
          imageView.tag = Int(concatenateInt)!
          lstTagImage.append(Int(concatenateInt)!)
          imageView.image = UIImage(named: imageString)
          self.view.addSubview(imageView)
  </code></pre>
  
  <p><strong>code 2:</strong> </p>
  
  <pre><code>@IBAction func undoButton(_ sender: UIButton) {
      if (lstPoint.count != 0){
          lstPoint.remove(at: lstPoint.count - 1)
          imageView.removeFromSuperview()
      } else {
          print("list empty")
      }
  }
  </code></pre>