SwiftUI utilities done (for now)

This commit is contained in:
John Estropia
2021-02-21 10:56:27 +09:00
parent f2efe175e5
commit d7b852fca4
25 changed files with 1154 additions and 203 deletions

View File

@@ -192,9 +192,18 @@ extension Internals {
return self.sections[section].elements.count
}
func sectionIndexTitles() -> [String] {
func sectionIndexTitle(for section: Int) -> String? {
return self.sections.compactMap({ $0.indexTitle })
guard self.sections.indices.contains(section) else {
return nil
}
return self.sections[section].indexTitle
}
func sectionIndexTitlesForAllSections() -> [String?] {
return self.sections.map({ $0.indexTitle })
}