title: getting touch location of uicollectionviewcell
body: <p>I am trying to get the touch location inside the selected 
  UICollectionviewCell.  I have a UIViewController, vc, containing a UICollectionView, collectionView, as its view.  Inside the collectionView are UICollectionViewCells.  The vc conforms to the <code>UICollectionViewDelegate</code> so preferably I would like to get the touched location inside the delegate callback, <code>collectionView:(UICollectionView *)collection didSelectItemAtIndexPath:(NSIndexPath *)indexPath</code>,  (if possible).  Any recommendation on how to do that?  Thanks.</p>
  
  <pre><code>+--------------------------------------------+
  | UICollectionView                           |
  |                                            |
  |  +-------------+       +-------------+     |
  |  |  UICollec   |       |             |     |
  |  |  tionView   |       |             |     |
  |  |  Cell       |       |     *&lt;---------------&lt;Touch here
  |  |             |       |             |     |
  |  +-------------+       +-------------+     |
  |                                            |
  +--------------------------------------------+    
  </code></pre>
  
  <p>*<strong><em>UPDATE</em>*</strong>
  I ended up detecting the tap on the <code>UIViewCollectionView</code> using the <code>UIGestureRecognizer</code> and then converting the tap point to the <code>UICollectionViewCell</code> view.  Please let me know if there's a better way.  Thanks.</p>
  
  <pre><code>-(void) viewDidLoad {
      UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
      [tapGesture setNumberOfTapsRequired:1];
      [self.collectionView addGestureRecognizer:tapGesture];
  }
  
  -(void) handleTap:(UIGestureRecognizer*) gesture {
      if (gesture.state == UIGestureRecognizerStateEnded) {
      CGPoint tappedPoint = [gesture locationInView:_collectionView];
      NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint:tappedPoint];
      CollectionViewCell *cell = (CollectionViewCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
      CGPoint pointWRTCell = [cell convertPoint:tappedPoint fromView:self.collectionView];
      NSLog(@"collectionView point(%1.1f,%1.1f); cell point (%1.1f,%1.1f)",
            tappedPoint.x,tappedPoint.y,pointWRTCell.x,pointWRTCell.y);
      }
  }
  </code></pre>