UIGestureRecognizer blocks subview for handling touch events

后端 未结 10 1040
北恋
北恋 2020-11-28 19:32

I\'m trying to figure out how this is done the right way. I\'ve tried to depict the situation: \"enter

10条回答
  •  失恋的感觉
    2020-11-28 20:10

    I was also doing a popover and this is how I did it

    func didTap(sender: UITapGestureRecognizer) {
    
        let tapLocation = sender.locationInView(tableView)
    
        if let _ = tableView.indexPathForRowAtPoint(tapLocation) {
            sender.cancelsTouchesInView = false
        }
        else {
            delegate?.menuDimissed()
        }
    }
    

提交回复
热议问题