我在Master-Detail設置的Master中有一個UITableView
。用戶可以通過UITableViewRowAction
與單元進行交互,也可以使用給定的搜索欄進行搜索。檢查在UITableViewCell中取消選擇
當用戶與搜索欄進行交互或將單元格向左滑動時,單元格將被取消選中。當一個單元格被取消選中時,我需要得到通知。
我試過func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
,但它似乎沒有迴應像這些的情況。
override func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
print("Cell Deselected")
}
這從來沒有在我上面給出的條件執行,但只有當tableView
不同項目被選中它並得到執行,這不是我所需要。
您是否正確設置了您的代表? – gEeKyMiNd
是的。我已經修改了這個問題更加清楚。 – Berry
你在調用'tableView.deselectRow(at:indexPath,animated:true)'? – CarpenterBlood