Section: Add a convenient method to add an amount of rows.

This commit is contained in:
SBiOSoftWhare
2020-09-28 14:23:39 +02:00
parent 43c8ad3017
commit 2b8ccfa853
+7 -1
View File
@@ -41,12 +41,18 @@ final class Section: NSObject {
addRow(Row.row(withTag: tag))
}
func addRows(withCount count: Int) {
for i in 0..<count {
addRow(Row.row(withTag: i))
}
}
func indexOfRow(withTag tag: Int) -> Int? {
return rows.firstIndex(where: { $0.tag == tag })
}
var hasAnyRows: Bool {
return rows.count > 0
return rows.isEmpty == false
}
}