Hi there! Thanks for your great article. I've learned a lot.
But I'm a little confused about this note:
Note : If you want to use titleForHeaderInSection and titleForFooterInSection both part of UITableViewDataSource, you can simply create UITableViewDiffableDataSource subclass and override the methods of you want to implement.
Why do I need to subclass UITableViewDiffableDataSource to use titleForHeaderInSection and titleForFooterInSection while the other delegate methods just work in ContactsTableViewController?
This is because titleForHeaderInSection and titleForFooterInSection are part of UITableViewDataSource and UITableViewDiffableDataSource conforms to UITableViewDataSource ... so to use both methods or any others datasource methods, you can simply create your UITableViewDiffableDataSource subclass and override the data source methods you want in your subclass.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi there! Thanks for your great article. I've learned a lot.
But I'm a little confused about this note:
Why do I need to subclass
UITableViewDiffableDataSource
to usetitleForHeaderInSection
andtitleForFooterInSection
while the other delegate methods just work inContactsTableViewController
?This is because titleForHeaderInSection and titleForFooterInSection are part of UITableViewDataSource and UITableViewDiffableDataSource conforms to UITableViewDataSource ... so to use both methods or any others datasource methods, you can simply create your UITableViewDiffableDataSource subclass and override the data source methods you want in your subclass.