UITapGestureRecognizer 打破 UITableView SelectRowAtIndexPath?

UITapGestureRecognizer breaks UITableView SelectRowAtIndexPath?

如果我在背景视图上添加点击手势,那么我必须长按 select 单元格,如果我将 numberoftaprequired 设置为 2,它将正常工作,但我必须在单击时提供一个功能

将 cancelsTouchesInView 添加到您的点击手势

let tap = UITapGestureRecognizer(target: self, action: #selector(yourfunction))
tap.cancelsTouchesInView = false

试试这个