Merge pull request #94 from dmertsalov/master

Add accessoryButton action support
This commit is contained in:
Max Sokolov 2019-05-29 09:34:05 +03:00 committed by GitHub
commit d6520346c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -355,6 +355,11 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
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])
}
open func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
invoke(action: .accessoryButtonTap, cell: cell, indexPath: indexPath)
}
}
// MARK: - Sections manipulation

View File

@ -80,6 +80,7 @@ public enum TableRowActionType {
case canMove
case canMoveTo
case move
case accessoryButtonTap
case custom(String)
var key: String {