title: Center First UICollectionViewCell in UICollectionView
body: <p>I have a <code>UICollectionView</code> that can either have a single cell or two cells.</p>
  
  <p>Is it possible for me to horizontally center the first cell and on panLeft have the second cell centered likewise - to the <code>UICollectionView</code> whose width sizes itself to the screen/view size and cell's proportionally adjusting as well?</p>
  
  <p>From the references I've seen, I believe I need to use the <code>UICollectionViewDelegateFlowLayout</code> <code>insetForSectionAt</code> method, but I'm not able to get it exactly centered for some reason, and also when it is just one cell, I believe the inset causes the <code>UICollectionView</code> to become scrollable because enough space was created..</p>
  
  <p><a href="https://i.stack.imgur.com/nAAPB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nAAPB.png" alt="Illustration 1st two is an example with 2 cells, last is example with 1 cell"></a></p>