diff --git a/Demo/Classes/Presentation/Controllers/MainController.swift b/Demo/Classes/Presentation/Controllers/MainController.swift index 3cdf176..a8360f4 100644 --- a/Demo/Classes/Presentation/Controllers/MainController.swift +++ b/Demo/Classes/Presentation/Controllers/MainController.swift @@ -25,7 +25,7 @@ class MainController: UIViewController { let clickAction = TableRowAction(.click) { [weak self] (data) in - switch (data.indexPath as NSIndexPath).row { + switch data.indexPath.row { case 0: self?.performSegue(withIdentifier: "autolayoutcells", sender: nil) case 1: diff --git a/Sources/TableKit.swift b/Sources/TableKit.swift index eebc57d..cf3ec49 100644 --- a/Sources/TableKit.swift +++ b/Sources/TableKit.swift @@ -75,6 +75,7 @@ public enum TableRowActionType { public protocol RowAction { + var id: String? { get set } var type: TableRowActionType { get } func invokeActionOn(cell: UITableViewCell?, item: Any, path: IndexPath) -> Any? diff --git a/Sources/TableRowAction.swift b/Sources/TableRowAction.swift index 38607c1..2bf5641 100644 --- a/Sources/TableRowAction.swift +++ b/Sources/TableRowAction.swift @@ -55,6 +55,7 @@ private enum TableRowActionHandler where CellType: U open class TableRowAction: RowAction where CellType: UITableViewCell { + open var id: String? open let type: TableRowActionType private let handler: TableRowActionHandler