My UITableView has two sections, so I created an enum for them:
private enum TableSections {
HorizontalSection,
VerticalSection
}
H
Ok, I figured it out, thanks @tktsubota for pointing me in the right direction. I'm pretty new to Swift. I looked into .rawValue and made some changes:
private enum TableSections: Int {
case HorizontalSection = 0
case VerticalSection = 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case TableSections.HorizontalSection.rawValue:
return firstArray.count
case TableSections.VerticalSection.rawValue:
return secondArray.count
default
return 0
}
}