ios - Gesture Recognizer never fires -
this have
uicollectionviewcontroller - uicollectionviewcell - uiscrollview - imageview
i trying handle tap on imageview never called.
uitapgesturerecognizer *tap =[[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(handletap:)]; [cell.imageview addgesturerecognizer:tap]; - (void)handletap:(uitapgesturerecognizer *)recognizer { nslog(@"tap"); nsindexpath *indexpath = [self.collectionview indexpathforitematpoint:[recognizer locationinview:self.collectionview]]; }
cell's imageview should allow user interaction first detect tap. make sure enable user interaction following line.
[cell.imageview setuserinteractionenabled:yes];
Comments
Post a Comment