diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index 41498bb..1b1cea1 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -184,4 +184,14 @@ extension TableDirector { return invokeAction(.shouldHighlight, cell: tableView.cellForRowAtIndexPath(indexPath), indexPath: indexPath) as? Bool ?? true } +} + +public func +=(left: TableDirector, right: RowBuilder) { + + left.appendSection(TableSectionBuilder(rowBuilders: [right])) +} + +public func +=(left: TableDirector, right: TableSectionBuilder) { + + left.appendSection(right) } \ No newline at end of file diff --git a/Tablet/TableRowBuilder.swift b/Tablet/TableRowBuilder.swift index 016fa2a..0ac2389 100644 --- a/Tablet/TableRowBuilder.swift +++ b/Tablet/TableRowBuilder.swift @@ -28,7 +28,7 @@ internal enum ActionHandler { case actionBlock((data: ActionData) -> Void) case actionReturnBlock((data: ActionData) -> AnyObject?) - func call(data: ActionData) -> AnyObject? { + func invoke(data: ActionData) -> AnyObject? { switch (self) { case .actionBlock(let closure): @@ -110,7 +110,7 @@ public class TableRowBuilder : RowBuilder { public func invokeAction(actionType: ActionType, cell: UITableViewCell?, indexPath: NSIndexPath, itemIndex: Int) -> AnyObject? { if let action = actions[actionType.key] { - return action.call(ActionData(cell: cell as? C, indexPath: indexPath, item: items[itemIndex], itemIndex: itemIndex)) + return action.invoke(ActionData(cell: cell as? C, indexPath: indexPath, item: items[itemIndex], itemIndex: itemIndex)) } return nil } diff --git a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate index 479978b..fe73904 100644 Binary files a/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate and b/TabletDemo/TabletDemo.xcodeproj/project.xcworkspace/xcuserdata/maxsokolov.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TabletDemo/TabletDemo/ViewController.swift b/TabletDemo/TabletDemo/ViewController.swift index ed353d5..af228c3 100644 --- a/TabletDemo/TabletDemo/ViewController.swift +++ b/TabletDemo/TabletDemo/ViewController.swift @@ -55,6 +55,6 @@ class ViewController: UIViewController { let sectionBuilder = TableSectionBuilder(headerTitle: "Tablet", footerTitle: "Deal with table view like a boss.", rowBuilders: [rowBuilder, configurableRowBuilder]) - tableDirector.appendSection(sectionBuilder) + tableDirector += sectionBuilder } } \ No newline at end of file