a gesture was added to the Uiscrollview UITapGestureRecognizer*_taprecognizer =[[UITapGestureRecognizer alloc] initwithtarget:self action: @selector (foregroundtapped:)]; _taprecognizer.Delegate=Self ; [_foregroundscrollview Addgesturerecognizer:_taprecognizer]; Didselectrowatindexpath will not execute immediately, delay 2-3 seconds before execution. That's certainly not true. After searching for information online, it was intercepted by UITapGestureRecognizer. The workaround is to override the following method in Uigesturerecognizerdelegate-(BOOL) Gesturerecognizer: (Uigesturerecognizer *) Gesturerecognizer Shouldreceivetouch: (Uitouch *) touch{//if Uitableviewcellcontentview (that is, click Tableviewcell), the touch event is not intercepted if([Nsstringfromclass ([Touch.viewclass]) Isequaltostring:@"Uitableviewcellcontentview"]) { returnNO; } returnYES;}
UITableView's didselectrowatindexpath fails after adding uitapgesturerecognizer gesture recognition in iOS