title: UICollectionView with flow layout won't put multiple items on one line
body: <p>I have a collectionView in which I am trying to create a grid style layout. I'm using a flowLayout and standard UICollectionViewCell's for now, but I can't seem to get the collectionView to put multiple items on the same line, as I believe the flowLayout should do by default. Here is my collectionView code:</p>
  
  <p>View Controller initialization code:</p>
  
  <pre><code>override init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
      let layout = UICollectionViewFlowLayout()
      layout.scrollDirection = .Horizontal
      collectionView = UICollectionView(frame: CGRectZero, collectionViewLayout: layout)     super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
      collectionView.delegate = self
      collectionView.dataSource = self
      collectionView.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: "cell")
      collectionView.backgroundColor = UIColor.whiteColor()
  }
  </code></pre>
  
  <p>View Did Load: </p>
  
  <pre><code>collectionView.frame = self.view.bounds
  collectionView.reloadData()
  self.view.addSubview(collectionView)
  </code></pre>
  
  <p>Delegate and Data Source:</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
      return 5
  }
  
  func numberOfSectionsInCollectionView(collectionView: UICollectionView) -&gt; Int {
      return 1
  }
  
  func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&gt; CGSize {
      return CGSize(width: 40, height: 40)
  }
  
  func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
      let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as UICollectionViewCell
      func getRandomColor() -&gt; UIColor{
          var randomRed:CGFloat = CGFloat(drand48())
          var randomGreen:CGFloat = CGFloat(drand48())
          var randomBlue:CGFloat = CGFloat(drand48())
          return UIColor(red: randomRed, green: randomGreen, blue: randomBlue, alpha: 1.0)
      }
      cell.backgroundColor = getRandomColor()
      return cell
  }
  </code></pre>
  
  <p>And this is what I get: </p>
  
  <p><img src="https://i.stack.imgur.com/qk1Lo.png" alt="enter image description here"></p>
  
  <p>Shouldn't the cells build sideways until the edge of the collectionView's frame is hit, and then go to a new line?
  Any idea why this isn't happening?</p>
  
  <p>Thanks,</p>