title: Reduce interitem spacing in UICollectionView
body: <p>I have already looked up:- </p>
  
  <p><a href="https://stackoverflow.com/questions/15514526/uicollectionview-distance-between-cells">UICollectionView distance between cells?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17229350/cell-spacing-in-uicollectionview?noredirect=1&amp;lq=1">Cell spacing in UICollectionView</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21071043/decrease-space-between-uicollectionviewcells?noredirect=1&amp;lq=1">Decrease Space between UICollectionViewCells</a></p>
  
  <p>but none of them worked for me.</p>
  
  <p>I also tried implementing the UICollectionViewDelegateFlowLayout and implemented </p>
  
  <pre><code> func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -&gt; CGFloat {
      return 3
  }
  </code></pre>
  
  <p>but it has no effect on it.</p>
  
  <p>Please have a look at the following screenshots taken in iPhone 7 / iPhone 5s / iPhone 7 Plus (picture order is same)</p>
  
  <p><a href="https://i.stack.imgur.com/fVFoK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fVFoK.png" alt="iPhone 7"></a></p>
  
  <p><a href="https://i.stack.imgur.com/wqP3N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wqP3N.png" alt="iPhone 5S"></a></p>
  
  <p><a href="https://i.stack.imgur.com/MkckB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MkckB.png" alt="iPhone 7 Plus"></a></p>
  
  <p>I also looked self-sizing cells, but I don't want self-sizing cells, as my item size is always fixed and meets my requirements.</p>
  
  <p>I have also set the <strong>minimum spacing of cells</strong> in the storyboard but it has no effect on the layout.</p>
  
  <p><strong>How to reduce the big gap between the two cells (interitem spacing), avoid clipping in the iPhone 5S and also the empty spaces on the right side in the iPhone 7 Plus (you can't see since the background is white)</strong></p>
  
  <p>Any insights will be appreciated.</p>