UITableView的侧移编辑功能,可多个

extension viewController: UITableViewDelegate {
    func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
        return true
    }

    func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
        let del = UITableViewRowAction(style: .default, title: "删除") { (act, indexpath) in
            print("你想删就删啊?我还没做好呢")
        }
        return [del]
    }
}

你可能感兴趣的:(IOS,swift)