iphone - UICollectionView delegate's tap method not getting called -


i have collection view, datasource delegate works well, uicollectionviewdelegate:

-(void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath {     nslog(@"didselect"); } 

not called, although set delegate (as did data source , worked) have mention cell loaded nib , connected subclass of uicollectionviewcell, anyway cells not respond touch. enabled user interaction in uiimageview in cell.

also :

-(bool)collectionview:(uicollectionview *)collectionview shouldselectitematindexpath:(nsindexpath *)indexpath {     nslog(@"this caled");     return yes; } 

is not getting called!

as mentioned did set:

[self.collectionview setdelegate:self]; 

and of course

<uicollectionviewdelegate> 

also don't have touchbegan override ..

update:

weird! gets called if long press! how can fix this, set delayscontenttouches no plus don`t have gesture recognizers implemented.

help please. thanks.

it looks there uitapgesturerecognizer somewhere in view hierarchy. default, uitapgesturerecognizers consume touch recieve, meaning not passed views below in hierarchy. need find rogue tap gesture , add line

tapgesturerecognizer.cancelstouchesinview = no; 

this make pass touches views below in hierarchy, , solve problem.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -