Right now I have a longPressGesture on my collection view cell.
@IBAction func longGesture(sender: AnyObject) {
if sender.state == UIGestureRecognizerState.Began
{
let location = sender.locationInView(sender.view)
println(location)
let index = whoCollectionView.indexPathForItemAtPoint(location)
println(index)
}
}
This is my code for the longPressGesture. I am getting good results on my location but for anything other then the last cell in the collectionView, I get nil for the index. On the last cell the index is 0.
I also tried replacing sender.view with self.view but that gives me weird results also. 60% of the long gestures I have return nil when I do this.