Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionView only calling didSelectItemAtIndexPath if user double taps, will not call when user single taps

I have a UICollectionView which is about the size of the screen. The UICollectionViewCells that it displays are the same size as the collectionView. Each cell has a UIImage which is the size of the cell. The CollectionView has paging enabled so essentially it is a full screen photo slideshow that the user can swipe through.

The problem is that
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath is only being called if the user taps with two fingers on a cell or long presses with one finger and then releases. It does not seem to have the default behaviour of single tap selection. I have not made any changes to the CollectionView gesture recognizer so am having trouble finding a solution to this problem.

like image 262
Kris Gellci Avatar asked May 08 '13 15:05

Kris Gellci


1 Answers

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.

like image 140
Owen Mathews Avatar answered Sep 24 '22 17:09

Owen Mathews