title: Adding a UICollectionViewController as a child UIView crashes
body: <p>I'm trying to add a custom <code>UICollectionViewController</code> in a child <code>UIView</code> and it crashes my app. Is there something wrong with my code or how my <code>CustomCollectionViewController</code> is implemented?</p>
  
  <pre><code>@IBOutlet weak var childView: UIView!
  let myCollectionView = CustomCollectionViewController()
  
  
  
  //inside viewDidLoad
  self.addChildViewController(self.myCollectionView)
  self.myCollectionView.didMoveToParentViewController(self)
  self.myCollectionView.view.frame = self.childView.bounds&lt;--crashes after executing this line
  self.childView.addSubview(self.myCollectionView.view)
  self.myCollectionView.delegate = self
  </code></pre>
  
  <p><img src="https://i.imgur.com/PcungWR.png" alt="error"></p>