Skip to content

Commit 38853bc

Browse files
committed
Fixed header and footers.
1 parent a69fdb9 commit 38853bc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Sources/SPDiffable/DataSource/SPDiffableCollectionDataSource.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ open class SPDiffableCollectionDataSource: UICollectionViewDiffableDataSource<SP
115115
snapshot.moveSection(section, afterSection: previousSection)
116116
}
117117

118+
// Set new header and footer
119+
120+
for checkSection in snapshot.sectionIdentifiers {
121+
if let newSection = sections.first(where: { $0.identifier == checkSection.identifier }) {
122+
checkSection.header = newSection.header
123+
checkSection.footer = newSection.footer
124+
}
125+
}
126+
118127
// Apply Changes
119128

120129
apply(snapshot, animated: true)

0 commit comments

Comments
 (0)