title: Xcode - UICollectionView inside UIViewController
body: <p>I'm trying to insert a collection view inside a UIViewController:</p>
  
  <pre><code>import UIKit
  
  class imagesViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {
  
      var labels = ["label1", "label2", "label3"]
  
      @IBOutlet weak var collectionView: UICollectionView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
  
          self.collectionView.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: "cell")
          collectionView.backgroundColor = UIColor.redColor()
  
          collectionView.delegate = self
          collectionView.dataSource = self
  
      }
  
  
  
  
      func numberOfSectionsInCollectionView(collectionView: UICollectionView) -&gt; Int {
          //#warning Incomplete method implementation -- Return the number of sections
          return 1
      }
  
      func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          //#warning Incomplete method implementation -- Return the number of items in the section
          return labels.count
      }
  
  
      func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! UICollectionViewCell
  
          // Configure the cell
  
          var title = UILabel(frame: CGRectMake(0, 0, cell.bounds.size.width, cell.bounds.size.height))
          cell.contentView.addSubview(title)
  
          title.text = labels[indexPath.row]
          title.textColor = UIColor.yellowColor()
  
          return cell
      }
  </code></pre>
  
  <p>The app runs but it doesn't seem that the collection view is linked properly to the class, none of the configurations I made works,it just appears blank. Strangely enough I had to copy/paste the functions for the collection view because the autocomplete only shows some of the collectionview methods. </p>