diff --git a/TableKit/ConfigurableCell.swift b/TableKit/ConfigurableCell.swift index d3363b4..4127139 100644 --- a/TableKit/ConfigurableCell.swift +++ b/TableKit/ConfigurableCell.swift @@ -21,9 +21,9 @@ import UIKit public protocol ConfigurableCell { - + associatedtype T - + static func reusableIdentifier() -> String static func estimatedHeight() -> CGFloat static func defaultHeight() -> CGFloat? @@ -31,15 +31,15 @@ public protocol ConfigurableCell { } public extension ConfigurableCell where Self: UITableViewCell { - + static func reusableIdentifier() -> String { return String(self) } - + static func estimatedHeight() -> CGFloat { return UITableViewAutomaticDimension } - + static func defaultHeight() -> CGFloat? { return nil } diff --git a/TableKit/Operators.swift b/TableKit/Operators.swift index 9dfb675..14a4326 100644 --- a/TableKit/Operators.swift +++ b/TableKit/Operators.swift @@ -18,37 +18,20 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -/*public func +=(left: TableDirector, right: RowBuilder) { - left.append(section: TableSectionBuilder(rows: [right])) -} - -public func +=(left: TableDirector, right: [RowBuilder]) { - left.append(section: TableSectionBuilder(rows: right)) -} - -public func +=(left: TableDirector, right: TableSectionBuilder) { +// -- +public func +=(left: TableDirector, right: TableSection) { left.append(section: right) } -public func +=(left: TableDirector, right: [TableSectionBuilder]) { +public func +=(left: TableDirector, right: [TableSection]) { left.append(sections: right) } -// - -public func +=(left: TableRowBuilder, right: DataType) { - left.append(items: [right]) -} - -public func +=(left: TableRowBuilder, right: [DataType]) { - left.append(items: right) -} - -// - -public func +=(left: TableSectionBuilder, right: RowBuilder) { +// -- +public func +=(left: TableSection, right: Row) { left.append(row: right) } -public func +=(left: TableSectionBuilder, right: [RowBuilder]) { +public func +=(left: TableSection, right: [Row]) { left.append(rows: right) -}*/ \ No newline at end of file +} \ No newline at end of file diff --git a/TableKit/TableRowAction.swift b/TableKit/TableRowAction.swift index e55b881..d4d10b7 100644 --- a/TableKit/TableRowAction.swift +++ b/TableKit/TableRowAction.swift @@ -75,9 +75,7 @@ public class TableRowAction Any? { return handler(data: TableRowActionData(item: item, cell: cell as? CellType, path: path, userInfo: nil)) } diff --git a/TableKit/TableSection.swift b/TableKit/TableSection.swift index 9ec231f..63b6deb 100644 --- a/TableKit/TableSection.swift +++ b/TableKit/TableSection.swift @@ -71,9 +71,8 @@ public class TableSection { public func append(row row: Row) { append(rows: [row]) } - + public func append(rows rows: [Row]) { - - + items.appendContentsOf(rows) } } \ No newline at end of file diff --git a/TableKitDemo/Classes/Presentation/Controllers/MainController.swift b/TableKitDemo/Classes/Presentation/Controllers/MainController.swift index b6bad3e..098588c 100644 --- a/TableKitDemo/Classes/Presentation/Controllers/MainController.swift +++ b/TableKitDemo/Classes/Presentation/Controllers/MainController.swift @@ -62,7 +62,7 @@ class MainController: UIViewController { let section = TableSection(headerTitle: "", footerTitle: "", rows: [row1, row2, row3]) - + tableDirector += [section] tableDirector.append(section: section)