滑动删除在 中不起作用maccatalyst
。相同的代码在 iPad 上运行良好。
UITableview
trailingSwipeActionsConfigurationForRowAt
中未调用该方法maccatalyst
。
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool
{
if indexPath.row == RestrictedDeletionRoom
{
return false
}
else
{
return true
}
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
tableView.deleteRows(at: [indexPath], with: .fade)
}
}
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let delete = UIContextualAction(style: .destructive, title: "Delete") { (action, sourceView, completionHandler) in
self.deletedRowDict …
Run Code Online (Sandbox Code Playgroud)