title: how to hide particular cells in collectionview in swift
body: <p>In my project i got a <strong>array</strong> which i am loading on my <strong>collectionview</strong></p>
  
  <pre><code>var dataSource = ["@", "@", "1", "2", "3", "4", "5", "6", "7", "8" , "9", "10", "@", "@"]
  </code></pre>
  
  <p>for the string "@" i want to hide that particular cell. so initially i was trying to do it using indexpath and then tried to check if my array position got value "@". But i am unable to hide it properly as some other cell would get changed on scroll</p>
  
  <p>So this what i have done on my <strong>cellForItemAt</strong> :</p>
  
  <pre><code>if dataSource[indexPath.row] == "@" {
  
              cell.contentView.isHidden = true
              cell.layer.borderColor = UIColor.white.cgColor
  
          }
  </code></pre>
  
  <p>Things to be considered its scrolling horizontally and this is my <strong>sizeForItemAt</strong> :</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView,
                          layout collectionViewLayout: UICollectionViewLayout,
                          sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
  
  
          return CGSize(width: (self.numberCollectionView?.bounds.size.width)!/5 - 3, height: (self.numberCollectionView?.bounds.size.width)!/5 - 3 )
      }
  </code></pre>