title: How can I segue from UICollectionView's cells embedded inside UITableViewCell (Swift)?
body: <p>I have used <a href="https://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell-in-swift/" rel="nofollow">this tutorial</a> to successfully embed a <code>UICollectionView</code> inside a <code>UITableView</code> I have in my ViewController.</p>
  
  <p>The following will probably make more sense if you have a quick look at the linked tutorial's code (plus its a nifty thing to learn too!):</p>
  
  <p>The next step for me is to perform segues from the cells of the <code>UICollectionView</code> inside the <code>UITableViewCell</code>s of the tableView, but as the collectionView outlet is established in a separate View Controller, I am not sure how to reference it in the main ViewController.</p>
  
  <p>In the TableViewCell.swift there is:</p>
  
  <pre><code>class TableViewCell: UITableViewCell {
      @IBOutlet private weak var collectionView: UICollectionView!
  } 
  
  extension TableViewCell {
      func setCollectionViewDataSourceDelegate&lt;D: protocol&lt;UICollectionViewDataSource, UICollectionViewDelegate&gt;&gt;(dataSourceDelegate: D, forRow row: Int) {
          collectionView.delegate = dataSourceDelegate
          collectionView.dataSource = dataSourceDelegate
          collectionView.tag = row
          collectionView.reloadData()
      }
  }
  </code></pre>
  
  <p>And in the ViewController.swift I need to be able to, for instance, call the <strong>collectionView</strong> that is in the TableViewCell in the <code>prepareForSegue</code> function that would go in the ViewController.swift file. I just need to fill the gaps with the collectionView outlet:</p>
  
  <pre><code>let destination = segue.destinationViewController as! SecondViewController
          let indexPaths = self.___________.indexPathsForSelectedItems()
          let indexPath = indexPaths![0] as NSIndexPath
          let arrayObject = self.arrayObjects[indexPath.row]
          destination.object = arrayObject
  </code></pre>
  
  <p>'object' is implemented in SecondViewController like so, <code>var object: PFObject!</code>.</p>
  
  <p>I now need to fill the gap, ________, in the above code with the collectionView in order to display the correct 'object' in SecondViewController (the destinationViewController)</p>