ios - UISwipeGestureRecognizer on view - If a touch is inside a UITableViewCell how to pass it to the cell? -
i added uiswipegesturerecognizer view changes content of view depending on direction user swipes(left or right). if user swipes in uitableviewcell though, touch gets ignored , swipe delete feature never shows up. how pass touch uitableviewcell?
what have done:
[swipeleft setcancelstouchesinview:no]; [swiperight setcancelstouchesinview:no]; -(void)swipeleft:(uiswipegesturerecognizer *)gesture { bool touchedinsidecell = no; cgpoint touchedpoint = [gesture locationinview:gesture.view]; (pcfcustomschedulecell *cell in self.tableview.visiblecells) { cgrect cellframe = cell.frame; if (cgrectcontainspoint(cellframe, touchedpoint)) { touchedinsidecell = yes; break; } } if (touchedinsidecell == no) { if (recordofday < 5) { recordofday++; [self.tableview reloaddata]; } }else { //i need pass touch uitableviewcell, swipe delete feature not working } }
i have returned yes in caneditrowatindexpath method, , works if refrain added these gesture recognizers. missing?
thanks!
make class delegate of gesture recogniser , can decide if gesture should handle incoming touches.
Comments
Post a Comment