Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #781: Remove swipe-to-delete in Sync settings
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub authored and kylehickinson committed Jan 23, 2019
1 parent 9be4779 commit d28ab4d
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Client/Frontend/Sync/SyncSettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,6 @@ class SyncSettingsTableViewController: UITableViewController {
return nil
}
}

override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
if indexPath.section != Sections.deviceList.rawValue { return false }

// First cell is our own device, we don't want to allow swipe to delete it.
return indexPath.row != 0
}

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {

guard let deviceToDelete = frc?.object(at: indexPath), editingStyle == .delete else { return }
deviceToDelete.remove()
}
}

// MARK: - NSFetchedResultsControllerDelegate
Expand Down

0 comments on commit d28ab4d

Please sign in to comment.