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, uitapgesturerecognizer
s 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
Post a Comment