title: Add a tap event to CollectionViewCell while passing Cell data
body: <p>I want to add a tap event to my <code>CollectionViewCell</code> and to pass there my <code>cell</code> with the data it has. How can I achieve this?
  Should this event be handled by my <code>ViewController</code> or by <code>CollectionViewCell</code>?</p>
  
  <p>My <code>ViewController</code>:</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
      let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CollectionViewCell", for: indexPath) as! CollectionViewCell
      cell.imgImage.image = imageArray[indexPath.row]
      cell.url = "xhini"
  
      return cell
  }
  </code></pre>
  
  <p>My <code>CollectionViewCell</code>:</p>
  
  <pre><code>class CollectionViewCell: UICollectionViewCell {
  
      @IBOutlet weak var imgImage: UIImageView!
      var url: String = "url"
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/3fimN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3fimN.png" alt="enter image description here"></a></p>