title: Present view controller in a container view at collection view didSelectItemAtIndexPath swift
body: <p>I am trying to present a view controller in a container view when i select a cell from a collection view. The problem is that I can't seem to understand how to present it in the container below the collection view.
  <a href="https://i.stack.imgur.com/3m8Sr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3m8Sr.png" alt="enter image description here"></a></p>
  
  <p>I tried: </p>
  
  <pre><code>if (indexPath.row == 0){
  
                  // Presenting first view controller
  
      let detailedViewController: ViewController =
            self.storyboard!.instantiateViewControllerWithIdentifier("ViewController") as! ViewController
  
                  self.presentViewController(detailedViewController, animated: true, completion: nil)
  </code></pre>
  
  <p>How can I make it go to the container instead of presenting the whole view controller.
  Thanks in advance!</p>