Post

Replies

Boosts

Views

Activity

Reply to Swift, iOS15, UIKit, CollectionView header issue
This here strangely solved it for me: lazy var collectionView: UICollectionView = { let collectionView = UICollectionView(/**/) // ...  collectionView.register(HeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: HeaderView.reuseId)  collectionView.register(HeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: HeaderView.reuseId)   // .... return collectionView }() And where I reuse the theader: func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {     let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: HeaderView.reuseId, for: indexPath) as! HeaderView // ... update header with data return header } In my collectionView I am only using headers. No footers at all.
Sep ’21