title: Using UICollectionViewController within Container - Swift
body: <p>Im trying to use a <code>UICollectionViewController</code> embedded within a container on my MainViewController</p>
  
  <p>Shown below:</p>
  
  <p><img src="https://i.stack.imgur.com/xPTXT.png" alt="enter image description here"></p>
  
  <p>Here is my CollectionViewController:</p>
  
  <pre><code>class ExistingProjectsCollectionViewController: UICollectionViewController, UICollectionViewDelegate, UICollectionViewDataSource {
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Uncomment the following line to preserve selection between presentations
          // self.clearsSelectionOnViewWillAppear = false
  
          // Register cell classes
          self.collectionView.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier)
  
      }
  
      // MARK: UICollectionViewDataSource
  
      override func numberOfSectionsInCollectionView(collectionView: UICollectionView!) -&gt; Int {
          //#warning Incomplete method implementation -- Return the number of sections
          return 1
      }
  
      override func collectionView(collectionView: UICollectionView!, numberOfItemsInSection section: Int) -&gt; Int {
          //#warning Incomplete method implementation -- Return the number of items in the section
          return 1000
      }
  
      override func collectionView(collectionView: UICollectionView!, cellForItemAtIndexPath indexPath: NSIndexPath!) -&gt; UICollectionViewCell! {
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as UICollectionViewCell
  
          // Configure the cell
  
          return cell
      }
  </code></pre>
  
  <p>However, for some reason when i run the application, the CollectionView scrolls, but contains no orange boxes. </p>
  
  <ul>
  <li><p>I've tried implementing it directly on the MasterViewController,
  which worked fine - so it seems to be something to do with using a
  UICollectionViewController within a Container. </p></li>
  <li><p>I've also tried turning off auto layout - with no success.</p></li>
  <li><p>I am using Swift on Xcode 6 Beta 6.</p></li>
  <li>I have ensured my re-usable cell id is "Cell" in storyboard</li>
  </ul>
  
  <p>Am i missing something obvious ?</p>