title: How to show three columns in a CollectionView using swift4 in all devices
body: <pre><code>func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
      
      
      if collectionView == self.collectionViewVideo {
  
          var collectionViewSize = collectionViewVideo.frame.size
          collectionViewSize.width = collectionViewSize.width/3.0 //Display Three elements in a row.
          return collectionViewSize
      } else {
          return CGSize(width: 60, height: 60)
      }
      
      
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/vtpt5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vtpt5.png" alt="i want to show my collectionview like this" /></a></p>