title: unwind from tap in cell collectionView
body: <p>I've been trying for hours but I do not understand how I hope someone can help me!</p>
  
  <p>In practice I have an initial VC I click on an image that takes me to a collectionView through a follow and the 2 elements are also joined by a NC.</p>
  
  <p>In the CollectionView are inserted images, which are contained in an array, I would like to touch on an image to return to the initial VC and that the image displayed is the one selected in the CollectionView.</p>
  
  <p>I tried with UnWind but I can not carry the information of the image index that I try to recover in the didselct.</p>
  
  <p>Viewcontroller</p>
  
  <pre><code>class ViewController: UIViewController {
  
      @IBOutlet weak var immagine: UIImageView!
  
      @IBAction func actionTap(_ sender: UITapGestureRecognizer) {
          print("tap")
          performSegue(withIdentifier: "selezione", sender: nil)
      }
  
      @IBAction func indietro(segue: UIStoryboardSegue){
  
          let recupero = segue.source as! CollectionViewController
          print(recupero.indice)
  
          immagine.image = UIImage(named: recupero.arrayImmagini[recupero.indice])
      }
  
      private let reuseIdentifier = "Cell"
  
      ...
  }
  </code></pre>
  
  <p>CollectionViewController</p>
  
  <pre><code>class CollectionViewController: UICollectionViewController {
  
      var arrayImmagini = ["globe","bed","home","toolbox"]
      var indice = 0
  
      override func numberOfSections(in collectionView: UICollectionView) -&gt; Int {
          return 1
      }
  
      override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return arrayImmagini.count
      }
  
      override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! CollectionViewCell
          cell.imgCell.image = UIImage(named: arrayImmagini[indexPath.row])
          return cell
      }
  
      override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
          //   print(arrayImmagini[indexPath.row])
          let indice = indexPath.row
          //   idImg = indexPath.row
      }
  
      ...
  }
  </code></pre>
  
  <p>even if set index = indexPath.row it is never recovered in the unwind</p>