Skip to content

Commit 5312fb4

Browse files
author
Gui Sabran
committed
call delegate after deletion
1 parent d452247 commit 5312fb4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/ReorderController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ public protocol TableViewReorderDelegate: class {
8484
Tells the delegate that the user has finished reordering and that the row was deleted.
8585
- Parameter tableView: The table view providing this information.
8686
- Parameter initialSourceIndexPath: The initial index path of the selected row, before reordering began.
87+
- Parameter lastIndexPath: The last index path of cell before it got deleted
8788
*/
88-
func tableViewDidFinishReorderingWithDeletion(_ tableView: UITableView, from initialSourceIndexPath: IndexPath)
89+
func tableViewDidFinishReorderingWithDeletion(_ tableView: UITableView, from initialSourceIndexPath: IndexPath, last lastIndexPath: IndexPath)
8990

9091
/**
9192
Tells the delegate that the user has moved the cell
@@ -127,7 +128,7 @@ public extension TableViewReorderDelegate {
127128
return false
128129
}
129130

130-
func tableViewDidFinishReorderingWithDeletion(_ tableView: UITableView, from initialSourceIndexPath: IndexPath) {
131+
func tableViewDidFinishReorderingWithDeletion(_ tableView: UITableView, from initialSourceIndexPath: IndexPath, last lastIndexPath: IndexPath) {
131132
}
132133
}
133134

@@ -331,6 +332,7 @@ public class ReorderController: NSObject {
331332

332333
UIView.performWithoutAnimation {
333334
tableView.deleteRows(at: [context.destinationRow], with: .none)
335+
delegate?.tableViewDidFinishReorderingWithDeletion(tableView, from: context.sourceRow, last: , to: context.destinationRow)
334336
}
335337
return
336338
}

0 commit comments

Comments
 (0)