title: Swift: UICollectionViewCell didSelectItemAtIndexPath Change backgroundColor
body: <p>I'm easily able to change the background color of a cell in the <code>CellForItemAtIndexPath</code> method</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath     indexPath: NSIndexPath) -&gt; UICollectionViewCell {
   cell.backgroundColor = UIColor.blackColor()
   }
  </code></pre>
  
  <p>However, when I attempt to change the color in the <code>DidSelectItemAtIndexPath</code> it does not work.</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath     indexPath: NSIndexPath) {
          let cell: ButtonCollectionCell = collectionView.dequeueReusableCellWithReuseIdentifier("ButtonCell", forIndexPath: indexPath) as! ButtonCollectionCell {
  cell.backgroundColor = UIColor.blackColor()
  </code></pre>
  
  <p>}</p>
  
  <p>Also I read somewhere that using <code>didSelectItemAtIndexPath</code> won't work because once the collection view begins scrolling the color will change back</p>
  
  <p>What is the fix in Swift?</p>
  
  <p>Thank you so much for your help</p>