title: Hiding UICollectionViewCell
body: <p>I'm trying to hide a <code>UICollectionViewCell</code> in a collection view. Although I'm successful when I do</p>
  
  <pre><code>cell.hidden = YES; //or cell.alpha = 0.0;
  </code></pre>
  
  <p>but after a scroll the cell appears again. I've also tried the following:</p>
  
  <pre><code>UICollectionViewLayoutAttributes *layoutAttr = &lt;get the layout attribute&gt;//I'm succesfull here
  layout.hidden = YES;
  [cell applyLayoutAttributes:layoutAttr];
  </code></pre>
  
  <p>I thought this might be because I'm using the <code>dequeReusable..</code> method and hence the cell is being re used, but
  I have also tried to hide the cell in the <code>collectionView:cellForItemAtIndexPath:</code> method to no avail. Here it doesn't even seem to work. </p>
  
  <p>Why is this not working? How can i hide a <code>UICollectionViewCell</code>? </p>
  
  <p>EDIT: Included the implementation of <code>collectionView:cellForItemAtIndexPath:</code>: </p>
  
  <pre><code>-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
  
      static NSString *identifier = @"Cell";
  
      UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
      cell.layer.cornerRadius  = 12.0f;
      cell.backgroundColor = [UIColor colorWithRed:0.830 green:0.899 blue:1.000 alpha:1.000];
  
      cell.selectedBackgroundView = [[UIView alloc]initWithFrame:cell.frame];
      cell.selectedBackgroundView.backgroundColor = [UIColor lightTextColor];;
      cell.layer.borderColor = [UIColor blackColor].CGColor;
      cell.layer.borderWidth = 2.0f;
      cell.hidden = YES;
      UILabel *lbl = (UILabel *)[cell viewWithTag:10];
      NSArray *interArray = numberArray[indexPath.section];
      [lbl setText:[interArray[indexPath.row] stringValue]];
  
      return cell;
  
  
  
  }
  </code></pre>
  
  <p>This should hide all the cells right? But nope, it doesn't happen.</p>