title: How to change UICollectionViewCell's background outside of cell
body: <p>How to change iOS UICollectionViewCell background outside of the cell?</p>
  
  <p>For instance, I have a view controller which implements <code>UICollectionViewDelegate</code> method:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self.collectionView registerClass:[MyCollectionViewCell class] forCellWithReuseIdentifier:MY_CELL_REUSE_IDENTIFIER];
  }
  
  - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      MyCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:MY_CELL_REUSE_IDENTIFIER forIndexPath:indexPath];
  
      if (condition)
      {
          [self actionOne];
          cell.backgroundColor = [UIColor redColor];
      }
  
      else
      {        
          [self actionTwo];
          cell.backgroundColor = [UIColor greenColor];
      }
  
      return YES;
  }
  </code></pre>
  
  <p>Breakpoints inside of <code>if (condition)</code> statement shows, that desired lines are executed. But, sadly, cells background stays the same...</p>
  
  <p>What is more, I am successfully doing practically the same thing id <code>UICollectionViewDataSource</code> method:</p>
  
  <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
      MyCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:MY_CELL_REUSE_IDENTIFIER forIndexPath:indexPath];
  
      cell.backgroundColor = [UIColor orangeColor];
  
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>