title: How to remove space between collection view cell?
body: <p>I have 3 cells, first cell has <strong>label</strong>, second cell has <strong>textfield</strong>, and the last cell has <strong>button</strong>, by using this it give automatic size but how to remove space between cells</p>
  
  <pre><code>if let flowlayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
              flowlayout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize
          }
  </code></pre>
  
  <p>or how to use this method in my scenario </p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
      code
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6rj6wl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6rj6wl.png" alt="enter image description here"></a></p>