title: Using UIViewControllerAnimatedTransitioning Without Storyboard Segues
body: <p>I have been attempting to create a custom transitioning segue and have been following the online tutorials to help me. I am creating my app programmatically without the Storyboard.</p>
  
  <p>I have a collection view cell that when tapped I would like to have a custom animated transition. All of the current tutorials use Storyboard segues. Most of the tutorials will create custom segues on the storyboard and then use some variation of the following function to call their custom segue:</p>
  
  <pre><code>override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      let vc = segue.destination as! ViewController
      let cell = sender as! PictureCell
      sourceCell = cell
      vc.picture = cell.picture.image
  
  }
  </code></pre>
  
  <p>Because I am not using storyboards I figure I will have to call my animated transition in the didselectitem function: </p>
  
  <pre><code> func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  }
  </code></pre>
  
  <p>I have all of the custom protocols and have set my UINaviationDelegate to include the custom animated transition: </p>
  
  <pre><code>extension FeedViewController: UINavigationControllerDelegate {
  func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -&gt; UIViewControllerAnimatedTransitioning? {
  
      return PopInAndOutAnimator(operation: operation)
  }
  }
  
  extension FeedViewController: CollectionPushAndPoppable {
  
  var collectionView: UICollectionView? {
      return ideasCollectionView
  }
  }
  </code></pre>
  
  <p>Here is an example of a tutorial that I have followed: <a href="http://www.stefanovettor.com/2015/12/25/uicollectionview-custom-transition-pop-in-and-out/" rel="nofollow noreferrer">http://www.stefanovettor.com/2015/12/25/uicollectionview-custom-transition-pop-in-and-out/</a></p>
  
  <p>How do I call my custom segue without the storyboard?</p>
  
  <p>I would really appreciate the help. I have been trying to figure this issue out for the past week. </p>
  
  <p>Thanks</p>