My UITableView has two sections, so I created an enum for them:
private enum TableSections {
HorizontalSection,
VerticalSection
}
H
Jeff Lewis did it right, to elaborate on that and give the code litlle bit of more readiness -> my way of handling these things is to:
guard let sectionType = TableSections(rawValue: section) else {
return 0
}
switch sectionType {
case .horizontalSection:
return firstArray.count
case .verticalSection:
return secondArray.count
}