Skip to content

Instantly share code, notes, and snippets.

@jeantimex
Created October 2, 2016 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeantimex/9eab23e6d959790cc290a71c8a06526c to your computer and use it in GitHub Desktop.
Save jeantimex/9eab23e6d959790cc290a71c8a06526c to your computer and use it in GitHub Desktop.
viewForHeaderInSection
override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let header = tableView.dequeueReusableHeaderFooterViewWithIdentifier("header") as? CollapsibleTableViewHeader ?? CollapsibleTableViewHeader(reuseIdentifier: "header")
header.titleLabel.text = sections[section].name
header.arrowLabel.text = ">"
header.setCollapsed(sections[section].collapsed)
header.section = section
header.delegate = self
return header
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment