Reputation: 738
I have made a custom xib UITableViewCell
with a UIButton
inside. The contentView
within the cell has, and must have .isUserInteractionEnabled = True
. The problem I am facing is that when using
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("selected row at index: \(indexPath)")
}
of UITableView
the function does not get called. I have read that for some reason I cannot have didSelectRowAt
working while contentView.isUserInteractionEnabled = True
. It's either one or the other type of deal. However, in my situation, I must have contentView.isUserInteractionEnabled = True
and didSelectRowAt
working. So what is a good workaround for this problem?
I already have :
tableView.dataSource = self
tableView.delegate = self
Upvotes: 1
Views: 175