Skip to content

Commit 15b52da

Browse files
committed
supplementaryViewProvider optional type documentation
1 parent 5e0ea7a commit 15b52da

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ tableView.register(CustomCell.self, forCellReuseIdentifier: "customCell")
114114
In order to use custom header or footer views, the `supplementaryViewProvider` property must be overritten.
115115

116116
```swift
117-
override var supplementaryViewProvider: UICollectionViewDiffableDataSource<Section, Item>.SupplementaryViewProvider {
117+
override var supplementaryViewProvider: UICollectionViewDiffableDataSource<Section, Item>.SupplementaryViewProvider? {
118118
return { (collectionView, kind, indexPath) in
119119
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "customHeader", for: indexPath) as? CustomHeader
120120
switch self.dataSource.snapshot().sectionIdentifiers[indexPath.section] {

Sources/FHDiffableViewControllers/FHDiffableCollectionViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ open class FHDiffableCollectionViewController<SectionIdentifierType, ItemIdentif
121121
///
122122
/// The default implementation just shows an empty section header.
123123
///
124-
/// override var supplementaryViewProvider: UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.SupplementaryViewProvider {
124+
/// override var supplementaryViewProvider: UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>.SupplementaryViewProvider? {
125125
/// return { (collectionView, kind, indexPath) in
126126
/// let supplementaryView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: /*your identifier*/, for: indexPath) as? CustomReuseableView
127127
/// /*customize your supplementary view here*/

0 commit comments

Comments
 (0)