Why does my UITableView not respond to touchesBegan?

后端 未结 3 918
-上瘾入骨i
-上瘾入骨i 2021-01-21 18:22

I am using this method

- (void)tableView:(UITableView *)tableView touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    UITouch *touch = [[event allTou         


        
3条回答
  •  滥情空心
    2021-01-21 18:58

    There is no such delegate method as tableView:touchesBegan:withEvent:. If you want to override -touchesBegan:withEvent: for your UITableView, you will need to subclass UITableView. Most problems like this are often better implemented with a UIGestureRecognizer. In the above, I'd probably use a UITapGestureRecognizer.

提交回复
热议问题