小编kal*_*thi的帖子

Mac Catalyst 滑动删除功能在 Mac 上不起作用

滑动删除在 中不起作用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)

uitableview ios swift mac-catalyst

2
推荐指数
1
解决办法
1106
查看次数

标签 统计

ios ×1

mac-catalyst ×1

swift ×1

uitableview ×1