📜  swift remove tableview cell - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.139000             🧑  作者: Mango

代码示例1
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
  if editingStyle == .delete {
    print("Deleted")

    self.catNames.remove(at: indexPath.row)
    self.tableView.deleteRows(at: [indexPath], with: .automatic)
  }
}