added operators to TableRowBuilder

This commit is contained in:
Max Sokolov 2015-12-11 17:54:03 +03:00
parent 558d2bccf3
commit b40306e771
3 changed files with 11 additions and 0 deletions

View File

@ -162,3 +162,13 @@ public extension TableRowBuilder {
items.removeAll()
}
}
public func +=<I, C>(left: TableRowBuilder<I, C>, right: I) {
left.appendItems([right])
}
public func +=<I, C>(left: TableRowBuilder<I, C>, right: [I]) {
left.appendItems(right)
}

View File

@ -32,6 +32,7 @@ class ViewController: UIViewController {
print("end display: \(data.indexPath)")
}
let configurableRowBuilder = TableConfigurableRowBuilder<String, ConfigurableTableViewCell>(items: ["5", "6", "7", "8"], estimatedRowHeight: 300)
.action(.click) { data -> Void in