Skip to content

Commit c9ea2e9

Browse files
committed
Added logs.
1 parent 3775f11 commit c9ea2e9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/SPDiffable/DataSource/SPDiffableCollectionDataSource.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,32 @@ open class SPDiffableCollectionDataSource: UICollectionViewDiffableDataSource<SP
9191
// In this case we shoudn't set header to section snapshot.
9292
// For this case it condition only.
9393
let headerAsFirstElement: Bool = {
94+
print("collectionView: \(collectionView)")
9495
if collectionView?.collectionViewLayout is UICollectionViewFlowLayout {
96+
print("return false")
9597
return false
9698
}
9799
if collectionView?.collectionViewLayout is UICollectionViewCompositionalLayout {
100+
print("return true")
98101
return true
99102
}
103+
print("return true 2")
100104
return true
101105
}()
106+
print("headerAsFirstElement \(headerAsFirstElement)")
102107

103108
for section in sections {
104109
var sectionSnapshot = SPDiffableSectionSnapshot()
105110

106111
if headerAsFirstElement {
112+
print("call as headerAsFirstElement")
107113
let header = section.header
108114
if let header = header {
109115
sectionSnapshot.append([header])
110116
}
111117
sectionSnapshot.append(section.items, to: header)
112118
} else {
119+
print("call as DONT headerAsFirstElement")
113120
sectionSnapshot.append(section.items)
114121
}
115122

0 commit comments

Comments
 (0)