ios-swift-collapsible-table-section
ios-swift-collapsible-table-section copied to clipboard
You need to register the header and cell
The view controller should register the cell and header classes in viewDidLoad()
tableView.register(CollapsibleTableViewHeader.self, forHeaderFooterViewReuseIdentifier: "header") tableView.register(CollapsibleTableViewCell.self, forCellReuseIdentifier: "cell")
Without registration dequeueReusableHeaderFooterView() and dequeueReusableCell() don't work. If you register then the two dequeue methods will never fail. You don't need that backup code in viewForHeaderInSection and cellForRowAtIndexPath if you register first.