On the iPhone there is a text book example of how to delete a tableview row in the Message Apps. This appears to use three separate views to perform the task.
My question is about whether there are short cuts to achieve this or do you just create three screens and to do the bleedin' obvious.
Many thanks.
I'm not really sure what you mean with three different views, but this would be the solution by an example to delete a row from
UITableView
:http://www.appcoda.com/model-view-controller-delete-table-row-from-uitableview/
You have to implement the necessary UITableViewDelegate and UITableViewDataSource methods.
First, add this:
Removing a row from storyboard is pretty straightforward. You just have to inherit 2 methods in your TableView Data source. First is telling if a row can be deleted:
Second is removing the row from table view:
Here's how to do this in Swift (4):
Following steps you should follow when deleting any row from a tableView:
Get the
indexPath
of row to be deleted.Remove the row from data model of the tableView DataSource.
[yourDataModel removeObjectAtIndex:indexPath.row];
[tableView reloadData];
Let me know if more info needed.