add id to action

This commit is contained in:
Max Sokolov 2016-10-15 01:31:05 +03:00
parent c040613654
commit 5f6de4703a
3 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,7 @@ class MainController: UIViewController {
let clickAction = TableRowAction<ConfigurableTableViewCell>(.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:

View File

@ -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?

View File

@ -55,6 +55,7 @@ private enum TableRowActionHandler<CellType: ConfigurableCell> where CellType: U
open class TableRowAction<CellType: ConfigurableCell>: RowAction where CellType: UITableViewCell {
open var id: String?
open let type: TableRowActionType
private let handler: TableRowActionHandler<CellType>