Merge pull request #77 from mrojas/master
Added support for moving rows
This commit is contained in:
commit
d8ae329118
|
|
@ -273,6 +273,10 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
|||
invoke(action: .clickDelete, cell: tableView.cellForRow(at: indexPath), indexPath: indexPath)
|
||||
}
|
||||
}
|
||||
|
||||
open func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
|
||||
invoke(action: .move, cell: tableView.cellForRow(at: sourceIndexPath), indexPath: sourceIndexPath, userInfo: [TableKitUserInfoKeys.CellMoveDestinationIndexPath: destinationIndexPath])
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Sections manipulation
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ struct TableKitNotifications {
|
|||
static let CellAction = "TableKitNotificationsCellAction"
|
||||
}
|
||||
|
||||
public struct TableKitUserInfoKeys {
|
||||
public static let CellMoveDestinationIndexPath = "TableKitCellMoveDestinationIndexPath"
|
||||
}
|
||||
|
||||
public protocol RowConfigurable {
|
||||
|
||||
func configure(_ cell: UITableViewCell)
|
||||
|
|
@ -65,6 +69,7 @@ public enum TableRowActionType {
|
|||
case height
|
||||
case canEdit
|
||||
case configure
|
||||
case move
|
||||
case custom(String)
|
||||
|
||||
var key: String {
|
||||
|
|
|
|||
Loading…
Reference in New Issue