UICollectionView only calling didSelectItemAtIndexPath if user double taps, will not call when user single taps
Are you sure you're not accidentally overriding - (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath
? "Select" vs. "deselect" has tripped me up in the past with Xcode's code completion.
I was just having the same problem and it turned out that there was a UITapGestureRecognizer
on the UIView
containing the UICollectionView
and it was responding instead.
That explains why didSelectItemAtIndexPath
works only if the user taps with two fingers or long presses with one finger because that doesn't trigger the UITapGestureRecognizer
.
So, check all the UITapGestureRecognizer
you got there, not necessarily on the UICollectionView
directly but it could be on any UIView
containing it.
If you have a view on the cell which obstructs the cells content view that is intractable then you will not be able to hook into the delegate callback for the cell.
You will want to disable user interaction on the obstructing view either in the NIB or in the code.
view.userInteractionEnabled = NO;