From 795fd7d0f13ea5bc25312fe7adab22946b3b0bc4 Mon Sep 17 00:00:00 2001 From: Guglielmo Faglioni Date: Fri, 2 Jul 2021 16:05:16 +0200 Subject: [PATCH] Fallback to non-skeleton Header (#416) 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. --- Sources/Collections/SkeletonCollectionDataSource.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Collections/SkeletonCollectionDataSource.swift b/Sources/Collections/SkeletonCollectionDataSource.swift index 393d1cda..dc86feb1 100644 --- a/Sources/Collections/SkeletonCollectionDataSource.swift +++ b/Sources/Collections/SkeletonCollectionDataSource.swift @@ -107,7 +107,7 @@ extension SkeletonCollectionDataSource: UICollectionViewDataSource { return view } - return UICollectionReusableView() + return originalCollectionViewDataSource?.collectionView?(collectionView, viewForSupplementaryElementOfKind: kind, at: indexPath) ?? UICollectionReusableView() } }