diff --git a/Demo/Classes/Presentation/Controllers/MainController.swift b/Demo/Classes/Presentation/Controllers/MainController.swift index e8812d1..3569741 100644 --- a/Demo/Classes/Presentation/Controllers/MainController.swift +++ b/Demo/Classes/Presentation/Controllers/MainController.swift @@ -46,52 +46,11 @@ class MainController: UIViewController { .addAction(TableRowAction(.click) { (data) in print("2") - - }) - let section = TableSection() section.append(builder: b) - //let section = TableSection(headerTitle: "", footerTitle: "", rows: [row1, row2, row3]) - tableDirector += [section] - - //tableDirector.append(section: section) - - - - - - - /*rowBuilder - .addAction(TableRowAction(type: .Click) { (data) in - - - }) - - rowBuilder - .delete(indexes: [0], animated: .None) - .insert(["2"], atIndex: 0, animated: .None) - .update(index: 0, item: "", animated: .None) - .move([1, 2], toIndexes: [3, 4]) - - - - //tableView.moveRowAtIndexPath(<#T##indexPath: NSIndexPath##NSIndexPath#>, toIndexPath: <#T##NSIndexPath#>) - //tableView.deleteRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>) - //tableView.insertRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>) - //tableView.reloadRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>) - - //tableView.moveSection(0, toSection: 0) - //tableView.reloadSections([], withRowAnimation: .None) - //tableView.deleteSections([], withRowAnimation: .None) - //tableView.insertSections([], withRowAnimation: .None) - - //tableDirector.performBatchUpdates { - //}*/ - - //tableDirector.append(section: section) } } \ No newline at end of file diff --git a/Sources/TableSection.swift b/Sources/TableSection.swift index 71fe404..e09078e 100644 --- a/Sources/TableSection.swift +++ b/Sources/TableSection.swift @@ -66,8 +66,16 @@ public class TableSection { public func append(row row: Row) { append(rows: [row]) } - + public func append(rows rows: [Row]) { items.appendContentsOf(rows) } + + public func insert(row row: Row, atIndex index: Int) { + items.insert(row, atIndex: index) + } + + public func delete(index: Int) { + items.removeAtIndex(index) + } } \ No newline at end of file