UICollectionReuasbleView not showing
UICollectionView Section Header not showing
사용한 UICollectionReusableView는
StickerDetailFeedHeaderCollectionReusableView.xib
StickerDetailFeedHeaderCollectionReusableView.swift
입니다.
Identifier도 StickerDetailFeedHeaderCollectionReusableView
collectionView.register(StickerDetailFeedHeaderCollectionReusableView.self,
forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
withReuseIdentifier: Const.Identifier.StickerDetailFeedHeaderCollectionReusableView)
dataSource.supplementaryViewProvider = { (collectionView, kind, indexPath) -> UICollectionReusableView in
guard let header = collectionView.dequeueReusableSupplementaryView(
ofKind: UICollectionView.elementKindSectionHeader,
withReuseIdentifier: Const.Identifier.StickerDetailFeedHeaderCollectionReusableView,
for: indexPath) as? StickerDetailFeedHeaderCollectionReusableView else {
return UICollectionReusableView() }
return header
}
collectionView.register(UINib(nibName: Const.Identifier.StickerDetailFeedHeaderCollectionReusableView,
bundle: nil),
forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
withReuseIdentifier: Const.Identifier.StickerDetailFeedHeaderCollectionReusableView)
register할 때 class에서 UINIb로 바꿔주니 잘 보였다