Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You need to register the header and cell #31

Open
phoney opened this issue Sep 19, 2017 · 0 comments
Open

You need to register the header and cell #31

phoney opened this issue Sep 19, 2017 · 0 comments

Comments

@phoney
Copy link

phoney commented Sep 19, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant