title: How to send a selected collectionview cell to another view controller (ios)?
body: <p>I'm being able to detect the selected row (image) in my collection view, But I need to send it to another view controller. Here is a part of the code : </p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
  
      if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as? CollectionViewCell {
  
          cell.cellImage.image = UIImage(named: images[indexPath.row])
          return cell
      } else {
          return CollectionViewCell()
  
      }
  }
  
  //Printinig the selected image ID in console
  func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
  {
      SelectedItem = indexPath.row + 1
      print(SelectedItem)
  }
  
  //Navigate to MPViewController
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      let DestViewController = segue.destination as!  MPViewController
      DestViewController.labelText = String(SelectedItem)
  }
  }
  </code></pre>