title: swift fatal error: unexpectedly found nil while unwrapping an Optional value
body: <p>I'm new to swift and I can't quite figure out how to address this error. </p>
  
  <p>I'm creating a collection view and this is my code:</p>
  
  <pre><code>import UIKit
  
  class FlashViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
  
      @IBOutlet weak var collectionView: UICollectionView!
  
          override func viewDidLoad() {
          super.viewDidLoad()
          // Move on ...
          let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
          layout.sectionInset = UIEdgeInsets(top: 20, left: 10, bottom: 10, right: 10)
          layout.itemSize = CGSize(width: 90, height: 90)
          collectionView = UICollectionView(frame: self.view.frame, collectionViewLayout: layout)
          self.collectionView.dataSource = self
          self.collectionView.delegate = self
          collectionView.registerClass(CollectionViewCell.self, forCellWithReuseIdentifier: "CollectionViewCell")
          collectionView.backgroundColor = UIColor.whiteColor()
          self.view.addSubview(collectionView!)
      }
  
      func numberOfSectionsInCollectionView(collectionView: UICollectionView) -&gt; Int {
          return 1
      }
  
      func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return 20
      }
  
      func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CollectionViewCell", forIndexPath: indexPath) as CollectionViewCell
          cell.backgroundColor = UIColor.blackColor()
          cell.textLabel?.text = "\(indexPath.section):\(indexPath.row)"
          cell.imageView?.image = UIImage(named: "circle")
          return cell
      }
  }
  </code></pre>
  
  <p>every time I run it the <code>self.collectionView.dataSource = self</code> line gets highlighted and I get the above mentioned error.</p>