title: How can i add multiple sticker in imageview swift 3
body: <p>I am working on photoEditing app and i need to add sticker on it, i have one view which name is viewImageBackground and inside this view i have one image view. Using following code i am adding stickers on Image view.</p>
  
  <pre><code>    if selectedPhotos == "Goodies" {
  
              switch indexPath.row {
  
              case 0:
                  addStickers(#imageLiteral(resourceName: "Goodies-1.png"))
  
                  break
              case 1:
                  addStickers(#imageLiteral(resourceName: "Goodies-2.png"))
  
                  break
              case 2:
                  addStickers(#imageLiteral(resourceName: "Goodies-3.png"))
  
                  break
              case 3:
                  addStickers(#imageLiteral(resourceName: "Goodies-4.png"))
  
                  break
  
              default:
                  break
              }
          }
  </code></pre>
  
  <p>Add Sticker function </p>
  
  <pre><code>    func addStickers(_ imgImage: UIImage) {
  
      hideTextButtons()
  
      textView = UIView(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
      textView?.backgroundColor = UIColor.clear
      viewImgBackground.addSubview(textView!)
  
      //Content view
  
      gesture = "Stickers"
  
      var imgSticker  = UIImageView(frame: CGRect.init(x: 0.0, y: 0.0, width: 80, height: 80))
      imgSticker.image = imgImage
      imgSticker.contentMode = UIViewContentMode.scaleAspectFill
  
      imgSticker.isUserInteractionEnabled = true
      imgSticker.isMultipleTouchEnabled = true
  
      textView?.addSubview(imgSticker)
  
      deleteView = UIImageView(frame: CGRect(x: 0, y: 0, width: 25, height: 25))
      deleteView?.backgroundColor = UIColor.clear
      deleteView?.image = UIImage(named: "close_gold.png")
      deleteView?.isUserInteractionEnabled = true
      let singleTap = UITapGestureRecognizer(target: self, action: #selector(self.singleTap))
      deleteView?.addGestureRecognizer(singleTap)
      textView?.addSubview(deleteView!)
  
      panGesture = UIPanGestureRecognizer.init(target: self, action: #selector(handlePanGesture(_:)))
      panGesture.delegate = self
  
      pinchGesture = UIPinchGestureRecognizer.init(target: self, action: #selector(handlePinchGesture(_:)))
      pinchGesture.delegate = self
  
      textView?.addGestureRecognizer(panGesture)
      textView?.addGestureRecognizer(pinchGesture)
  
      rotateView = UIImageView(frame: CGRect(x: 0, y: (textView?.frame.size.height)! - 25, width: 25, height: 25))
      rotateView?.backgroundColor = UIColor.clear
      rotateView?.image = UIImage(named: "button_01.png")
      rotateView?.isUserInteractionEnabled = true
      textView?.addSubview(rotateView!)
  
      let panRotateGesture = UIPanGestureRecognizer(target: self, action: #selector(self.rotateViewPanGesture))
      rotateView?.addGestureRecognizer(panRotateGesture)
      panRotateGesture.require(toFail: panRotateGesture)
  
      let snapshotImage = UIImage.imageWithView(view: viewImgBackground)
      count += 1
  
      logoImages.append(snapshotImage)
  
  
  }
  </code></pre>
  
  <p>now my view is look like following image </p>
  
  <p><a href="https://i.stack.imgur.com/FJX1O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FJX1O.png" alt="enter image description here"></a></p>
  
  <p>now issue is that i need to add multiple stickers with gesture using this code my condition is satisfied 50% sticker is added on image view with gesture but i need to add multiple stickers which means whenever i click on each stickers new imageview with stickers needs to be added but this code will added only one sticker and replacing sticker inside view. how do i achieve it ? </p>
  
  <p><strong>NOTE:</strong> whenever i click on reset button i need to remove all this stickers so here u have declared imgSticker as a local variable which is not worth it so what can i do for adding multiple stickers on Image view. </p>
  
  <p>Please Help,
  Thanks!</p>