title: Animate UICollectionViewCell on Tap
body: <p>I would like to start some animation on a <code>UICollectionViewCell</code> when the user taps on a cell. My idea was to select the corresponding cell in <code>didSelectItemAtIndexPath</code> and trigger an animation. However, this doesn't work:</p>
  <pre class="lang-m prettyprint-override"><code>- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      // animate the cell user tapped on
      ProductCollectionViewCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:@&quot;ProductReuseID&quot; forIndexPath:indexPath];
      
      [UIView animateWithDuration:5.0
                            delay:0
                          options:(UIViewAnimationOptionAllowUserInteraction)
                       animations:^{
                           NSLog(@&quot;animation start&quot;);
                           [cell.layer setBackgroundColor:[UIColor colorWithRed: 180.0/255.0 green: 238.0/255.0 blue:180.0/255.0 alpha: 1.0].CGColor];
                       }
                       completion:^(BOOL finished){
                           NSLog(@&quot;animation end&quot;);
                           [cell.layer setBackgroundColor:[UIColor whiteColor].CGColor];
                       }
      ];
  }
  </code></pre>
  <p>Actually, the animation starts and ends at the same time (although <code>animateWithDuration</code> is set to 5). Next attempt was to skip the animation and simply set for instance a different border style:</p>
  <pre class="lang-m prettyprint-override"><code>- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      // animate the cell user tapped on
      ProductCollectionViewCell* cell = [collectionView dequeueReusableCellWithReuseIdentifier:@&quot;ProductReuseID&quot; forIndexPath:indexPath];
      
      [cell.layer setBorderWidth:5.0f];
  }
  </code></pre>
  <p>However, this doesn't change anything (probably because I have to redraw the cell manually?).</p>
  <p><strong>Do you have any ideas how to animate a UICollectionViewCell when the user tapped on it?</strong></p>
  <p>Kind regards,
  Christian</p>