title: How to center horizontally UICollectionView Cells?
body: <p>I have done some research, but I couldn't find any code example on how to center cells in a UICollectionView horizontally.</p>
  
  <p>instead of the first cell being like this <strong>X00</strong>, I want it to be like this <strong>0X0</strong>. is there any way to accomplish this?</p>
  
  <p>EDIT:</p>
  
  <p>to visualize what I want:</p>
  
  <p><a href="https://i.stack.imgur.com/fBjE1.png"><img src="https://i.stack.imgur.com/fBjE1.png" alt="enter image description here"></a></p>
  
  <p>I need it to look like version B when there is only one element in the CollectionView. When I got more than one element, then it should be like version A but with more elements.</p>
  
  <p>At the moment it looks like Version A when I have only 1 element, and I wonder how I can make it look like B.</p>
  
  <p>Thanks for the help!</p>