How can I add a GestureRecognizer for a UITableView, but only from scratch?

I want to add tap-hide table + some actions - named cancelTap

I have UITableView

, and I want to add cancelTap

for it , but only to an empty space . The table height is 200. The cells only fill half of the table, and on the other half (half without cells) I need to add addGestureRecognizer.

If I add the GestureRecognizer to the Table - the method DidSelectCellForRowAtIndexPath

doesn't respond. Are these any solutions?

+3


source to share


1 answer


I just add tap to tableView

and in the delegate of the set method Tap

-

(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
    return _searchDisplayController.contentSize.height <= [touch locationInView:_searchDisplayController].y;
}

      



in this method i want i need to apply tap or ined to ignore it.

+3


source







All Articles