title: iOS Swift: Collection View with paged scroll
body: <p>Evening,</p>
  
  <p>I have the current layout:</p>
  
  <ul>
  <li>a collection view paged with horizontal flow</li>
  <li>a single row on cells that have <code>width = collection view - 50.0</code></li>
  </ul>
  
  <p><strong>The problem:</strong></p>
  
  <p>When i scroll to the next page the cell does not appear aligned with the collection view.. </p>
  
  <p><strong>The reason:</strong></p>
  
  <p>the cell width did not cover the collection view width.</p>
  
  <p><strong>How to Fix:</strong></p>
  
  <p>I have no clue, i tried with didEndDragging delegate adding +50 on the content offset but it didn't work..</p>
  
  <p>I've also tried this:</p>
  
  <pre><code>if scrollView == self.badgeCollectionView {
        print(scrollView.contentSize)
        let point =  scrollView.contentOffset                      
        let index = badgeCollectionView.indexPathForItem(at: point)
        self.badgeCollectionView.selectItem(at: index, animated: false, scrollPosition: .left)
  }
  </code></pre>
  
  <p>Any tips?</p>