ra1028 / DiffableDataSources

💾 A library for backporting UITableView/UICollectionViewDiffableDataSource.
https://ra1028.github.io/DiffableDataSources
Apache License 2.0
853 stars 69 forks source link

Add support for specifying section header and footer titles #6

Closed simba909 closed 5 years ago

simba909 commented 5 years ago

This adds support for specifying section header and footer titles by subclassing TableViewDiffableDataSource, just like the official version.

Checklist

Description

This adds default implementations for tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) and tableView(_ tableView: UITableView, titleForFooterInSection section: Int), but leaving them as open functions, letting subclasses override their behaviour.

Motivation and Context

When UITableViewDiffableDataSource was introduced, setting section header and footer titles was not supported. Support for this has since been added, so I thought it would be nice if this library was updated to mirror the official version.

Impact on Existing Code

None

ra1028 commented 5 years ago

@simba909 Thanks 👍