title: Xcode UICollectionview Cell Align Left
body: <p>I have a collectionview where each row contains 3 cells. Whenever there isn't 3 cells in a row, the cells will align to the middle. I want them to align left. How do I accomplish this?</p>
  
  <p>The image below shows my problem. How do I align Cell 4 to the left?</p>
  
  <p><a href="https://i.stack.imgur.com/urFkU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/urFkU.jpg" alt="enter image description here"></a></p>
  
  <p>This is the current code I have the controls the sizes and insets:</p>
  
  <pre><code>- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
  {
      return UIEdgeInsetsMake(0, 10, 0, 10);
  }
  
  - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
  {
  
      CGRect screenBound = [[UIScreen mainScreen] bounds];
      CGSize screenSize = screenBound.size;
      CGFloat screenWidth = screenSize.width;
      CGFloat screenHeight = screenSize.height;
  
      return CGSizeMake(screenWidth/3-20, 80); //three cells per row
  
  }
  </code></pre>
  
  <p>Thank you in advance.</p>