ios-swift-collapsible-table-section icon indicating copy to clipboard operation
ios-swift-collapsible-table-section copied to clipboard

You need to register the header and cell

Open phoney opened this issue 6 years ago • 0 comments

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.

phoney avatar Sep 19 '17 17:09 phoney