title: Grid Layout in CollectionView?
body: <p>So i have a collectionViewController that I am trying to implement a grid layout in. I know that the sizeForItemAt controls the size but no matter how many times I play with it I just can't get it to be a three by three grid and it's really confusing me. Any help is greatly appreciated. I only added the sizeForItemAt method to save everyone some time.</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
      let width = (view.frame.width - 2)/3
      return CGSize(width: width, height: width)
  }
  </code></pre>
  
  <p>This is what my VC currently looks like</p>
  
  <p><a href="https://i.stack.imgur.com/mGG7l.png" rel="nofollow noreferrer">enter image description here</a></p>