diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-11-03 03:40:23 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-11-03 03:43:09 +0100 |
commit | 007d6d9c58c4e9e425fd791f7a41d9b14231e210 (patch) | |
tree | a08de8650f30937b2ebd8ccf26b7ccd63e331380 /WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | |
parent | Global: no periods at the end of error messages (diff) | |
download | wireguard-apple-007d6d9c58c4e9e425fd791f7a41d9b14231e210.tar.xz wireguard-apple-007d6d9c58c4e9e425fd791f7a41d9b14231e210.zip |
TunnelsManager: get rid of index management
No need for premature optimization. There aren't that many tunnels most
of the time, and calling sort on a partially sorted array is fast.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift index 9515885..1ab7dd7 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift @@ -312,11 +312,11 @@ extension TunnelsListTableViewController: TunnelsManagerDelegate { func tunnelModified(at index: Int) { tableView.reloadRows(at: [IndexPath(row: index, section: 0)], with: .automatic) } - - func tunnelsChanged() { - tableView.reloadData() + + func tunnelMoved(at oldIndex: Int, to newIndex: Int) { + tableView.moveRow(at: IndexPath(row: oldIndex, section: 0), to: IndexPath(row: newIndex, section: 0)) } - + func tunnelRemoved(at index: Int) { tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .automatic) } |