How to enable move but disable delete for some row in UITableView

Some lines in my UITableView should delete and move in edit mode, but some just move. In this method, I can enable or disable editing for some lines

override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool{
            return true
    }

But how to disable deletion for some lines with move enabled?

+4
source share
1 answer

Refund .Nonefor editingStyleForRowAtIndexPath:

func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {
     return .None
}

A more complete answer showing how to remove indentation is here → Is there a way to hide the "-" (Delete) while editing a UITableView

+3
source

All Articles