support insert many rows in section
This commit is contained in:
parent
85cf81ecd6
commit
155524f13c
|
|
@ -230,7 +230,6 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate
|
|||
|
||||
public func append(sections sections: [TableSection]) -> Self {
|
||||
|
||||
sections.forEach { $0.tableDirector = self }
|
||||
self.sections.appendContentsOf(sections)
|
||||
return self
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@
|
|||
import UIKit
|
||||
|
||||
public class TableSection {
|
||||
|
||||
weak var tableDirector: TableDirector?
|
||||
|
||||
|
||||
public private(set) var rows = [Row]()
|
||||
|
||||
public var headerTitle: String?
|
||||
|
|
@ -78,10 +76,14 @@ public class TableSection {
|
|||
self.rows.appendContentsOf(rows)
|
||||
}
|
||||
|
||||
public func insert(row row: Row, atIndex index: Int) {
|
||||
public func insert(row row: Row, at index: Int) {
|
||||
rows.insert(row, atIndex: index)
|
||||
}
|
||||
|
||||
public func insert(rows rows: [Row], at index: Int) {
|
||||
self.rows.insertContentsOf(rows, at: index)
|
||||
}
|
||||
|
||||
public func delete(index index: Int) {
|
||||
rows.removeAtIndex(index)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue