title: How to expand collectionview cell on didselect to show more info?
body: <p>I want to animate my collectionview cell so that when I touch it, a mapview slides out from underneath it and basically expands into the space, by pushing the cell underneath it down a little bit. I tried using this: <a href="https://stackoverflow.com/questions/13780153/uicollectionview-animate-cell-size-change-on-selection">UICollectionView: Animate cell size change on selection</a>, but was unable to get it to work properly.</p>
  
  <p>Here what I tried.</p>
  
  <pre><code>- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
  
      [((FeedCell *)[collectionView cellForItemAtIndexPath:indexPath]) setIsSelected:YES];
  
       [collectionView.collectionViewLayout invalidateLayout];
      __weak FeedCell *cell = (FeedCell *)[self.photoCollectionView cellForItemAtIndexPath:indexPath]; // Avoid retain cycles
      void (^animateChangeWidth)() = ^()
      {
          CGRect frame = cell.frame;
          frame.size = CGSizeMake(frame.size.width, 420);
          cell.frame = frame;
      };
  
      // Animate
  
      [UIView transitionWithView:[collectionView cellForItemAtIndexPath:indexPath] duration:0.5f options: UIViewAnimationOptionCurveLinear animations:animateChangeWidth completion:nil];
  
  }
  
  
  
  - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
  
      if(((FeedCell *)[self.photoCollectionView cellForItemAtIndexPath:indexPath]).isSelected == YES){
          return CGSizeMake(320, 420);
      }
       return CGSizeMake(320, 320);
  
  }
  </code></pre>
  
  <p>I have a custom CollectionView cell and it has a property for isSelected. I'm not sure what I should do for the xib of the cell (whether to put the map view in there, have the CGSize be the selected size or deselected size, etc.) Any help would really be appreciated!</p>