title: get indexpath from collectionView, sometime get the wrong indexPath
body: <p>in <code>UItableView</code> we can use those code to get <code>indexPath</code> from a <code>UITableView</code></p>
  
  <pre><code>extension UIView{  
    func getButtonIndexPath(tableView:UITableView) -&gt; NSIndexPath{
              let buttonOriginInTableView = self.convertPoint(CGPointZero, toView: tableView)
              return tableView.indexPathForRowAtPoint(buttonOriginInTableView)!
          }
  }
  </code></pre>
  
  <p>But it doesn't work so well in <code>UICollectionView</code></p>
  
  <pre><code>extension UIView{
      func getIndexPath(uc:UICollectionView) -&gt; NSIndexPath?{
          let senderP = CGPointMake(0, self.frame.height / 2)
              let point : CGPoint = self.convertPoint(senderP, toView:uc)
              let ind = uc.indexPathForItemAtPoint(point)
              print("what i click is", point, ind)
          return ind
  }
  </code></pre>
  
  <p>i put this in a button of a cell in <code>UICollectionView</code></p>
  
  <pre><code>delBtn.addTarget(self, action: #selector(FavViewController.DelFavAction(_:)), forControlEvents: .TouchUpInside)
  </code></pre>
  
  <p>and the function is </p>
  
  <pre><code>    func DelFavAction(sender:UIButton){
      guard let indexPath = sender.getIndexPath(self.collectionView) else {
      return
      }
      print(indexPath)
  }
  </code></pre>
  
  <p>but mostly get the wrong <code>indexPath.item</code>, how is that happening?</p>
  
  <p>is something to do with this code?</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&gt; CGSize {
      return rectArr[indexPath.item].size
  }
  </code></pre>