title: IOS: Selecting UICollectionView Cell by Long Press
body: <p>I'm using <code>UICollectionView</code> to generate a image gallery.I used <code>UIImage</code> inside the <code>UICollectionView</code> Cell to load the images.I need to select <code>UICollectionView</code> Cell by Long Press (not by single tap).</p>
  
  <pre><code>- (IBAction)longPress:(UILongPressGestureRecognizer *)gestureRecognizer
  {
  
      UICollectionViewCell *cell=(UICollectionViewCell *)[gestureRecognizer view];
      int index=cell.tag;
  
      OverlayImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, cell.frame.size.width,     cell.frame.size.height)];
      OverlayImage.image = [UIImage imageNamed:@"Overlay@2x.png"];
      [cell addSubview:OverlayImage];
  
  }
  </code></pre>