Reputation: 10738
Can someone describe the process to edit/change the content from a row in a UITableView?
It looks like there is no enumerator for edit
.
From the docs: UITableViewCellEditingStyle
Here is how I delete rows and update table.
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == UITableViewCellEditingStyle.Delete {
myArray.removeAtIndex(indexPath.row)
myTableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic)
}
}
Upvotes: 0
Views: 792
Reputation: 11127
With the below code you can update any single cell of tableview
let indexPath = NSIndexPath(forRow: path, inSection: section)
tableView.beginUpdates()
self.tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.None)
tableView.endUpdates()
Upvotes: 1