title: How to enable/disable a view element inside CollectionView Cell from UITapGestureRecognizer function
body: <p>I'm pretty sure you didn't get the idea of the question from the heading, so let me explain.</p>
  
  <p>I have a view called <strong>TextView2</strong> inside the <strong>CollectionViewCell</strong>. This view repeats in every cell. Inside this <strong>TextView2</strong> there is an <strong>imageView</strong> of a download button. I want to disable this <strong>imageView</strong> whenever the user clicks on the <strong>TextView2</strong>.</p>
  
  <p>I created a <strong>tapGestureRecognizer</strong> for <strong>textView2</strong> and all seems to work fine except the <strong>imageView</strong> that disables when clicked is the <strong>imageView</strong> inside the last <strong>collectionViewCell</strong>. How do I make it to disable the <strong>imageView</strong> of the cell that I clicked? I know I have to make use of the index path somehow but I couldn't make it work. </p>
  
  <p>This is a rough idea of how the code work.</p>
  
  <pre><code>var downloadImageView = UIImageView()
  
  override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
      let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as? JSQMessagesCollectionViewCell
      let textView2 = EdgeInsetLabel(frame: CGRect(x: CGFloat(0), y: CGFloat(0) , width: CGFloat(250), height: CGFloat(70)))
      downloadImageView = UIImageView(frame:CGRect(x: 110, y: 0, width: 10, height: 10))
      downloadImageView.image = downloadIcon
      downloadImageView.frame = CGRect(x: 190, y: 20, width: 20, height: 20)
      textView2.addSubview(downloadImageView)
  
      let tapGesture : UITapGestureRecognizer = UITapGestureRecognizer.init(target: self, action:  #selector(messageTapped(_:)))
  textView2.addGestureRecognizer(tapGesture)
      cell.addSubview(textView2)
      return cell
  
  }
  
  @objc func messageTapped(_ sender: UITapGestureRecognizer) {
  
      downloadImageView.isHidden = true
  
  }
  </code></pre>
  
  <p>Please help me to make it to disable the <strong>imageView</strong> of the cell clicked instead of the last cell of <strong>collectionView</strong>. I am a beginner in Swift all help is appreciated.</p>