Skip to content

Commit

Permalink
Fallback to non-skeleton Header (#416)
Browse files Browse the repository at this point in the history
Sometimes my collectionview's header doesn't need to be 'skeletoned' while the content does.  

When  collectionSkeletonView(_ skeletonView: UICollectionView, supplementaryViewIdentifierOfKind: String, at indexPath: IndexPath) -> ReusableCellIdentifier? returns nil, it's best if we fallback to the non-skeleton header.
  • Loading branch information
guidev committed Jul 2, 2021
1 parent 6cc6f5a commit 795fd7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Collections/SkeletonCollectionDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extension SkeletonCollectionDataSource: UICollectionViewDataSource {
return view
}

return UICollectionReusableView()
return originalCollectionViewDataSource?.collectionView?(collectionView, viewForSupplementaryElementOfKind: kind, at: indexPath) ?? UICollectionReusableView()
}

}
Expand Down

0 comments on commit 795fd7d

Please sign in to comment.