title: UICollectionView custom horizontal paging layout
body: <p>[![collectionview example][1]][1]</p>
  
  <p>I am trying to emulate this behavior using a collection view. I have started by working with this method and it has gotten me closer.  Although as I swipe further and further right on my horizontal paging CollectionView, the content shifts further and further left. Also the spacing between the cells is off.   I believe it requires a custom layout, but am not sure.</p>
  
  <pre><code>    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&gt; CGSize {
  
      return CGSize(width: collectionView.frame.width - 20, height: collectionView.frame.height - 20)
  
  }
  </code></pre>