ios - How to keep Gestures Recognizers from Intercepting Messages for a Child -
i have uiview contains table view.
i want user able select items in table view , want able identify taps in parent view, outside table view.
if add tab gesture recognizer uiview, user unable select items in table view.
how can accomplish task?
in case, you've add gesture view , can cancel gesture call method doing if touch happen on tableview below.
1) set tag tableview . self.tableview.tag = tag
;
2) cancel gesture if touch on tableview below
- (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldreceivetouch:(uitouch *)touch { id touchview= touch.view; if ([touchview iskindofclass:[uitableview class]] || [touchview iskindofclass:[uitableviewcell class]] ) { if ( ((uiview*)touchview).tag == tag) return no; } return yes; }
Comments
Post a Comment