Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Created August 17, 2017 08:33
Show Gist options
  • Save Dimillian/c6ca2f6067d069e3be1886ada7860c13 to your computer and use it in GitHub Desktop.
Save Dimillian/c6ca2f6067d069e3be1886ada7860c13 to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section <= Sections.count() - Sections.feedOffset() {
let sectionSwitch = Sections(rawValue: section)!
return sectionSwitch.headerView(controller: self)
}
switch filter {
case .books:
return MyBooksTableProvider.Sections(rawValue: section - 2)!.headerView()
default:
return nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment