Reputation: 512
I am trying to delete a section and it's rows in UITableView when user clicks on delete icon shown in section.
One solution i know, is delete object from array and reload the table, but this is not a process effective solution.
Upvotes: 2
Views: 3997
Reputation: 1750
Delete the section with the built in tableView method after deleting the data from the datasource.
datasource.deleteSection()
tableView.deleteSections(NSIndexSet(index: sectionIndex), withRowAnimation: .Automatic)
Upvotes: 2