0
行を削除してデータマネージャでも削除したいのですが、どのようにしてインデックスパスで削除するのですか?私はUserDefraultsを削除するindexPath.rowをどのように削除するのですか?
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete{
self.tableView.beginUpdates()
print("Deleted was pressed")
records.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .automatic)
// DataManager.getInstance().setNewRecord(array: [UserRecordDataManager])
// DataManager.getInstance().setNewRecord(array: UserRecordDataManager)
self.tableView.endUpdates()
tableView.reloadData()
print(records.count)
}
}
/// Data Manager- doing the SET option
public func setNewRecord(array: [UserRecordDataManager]){
records.remove=???
self.records = getRecords()
print(DataManager.getInstance().records.count)
}