Hello!
I have a collectionView and assigned a layout to it:
collectionView.collectionViewLayout = createLayout(hasHeader: true)
func createLayout(hasHeader: Bool) -> UICollectionViewCompositionalLayout {
let layout = UICollectionViewCompositionalLayout { [weak self] (section,environment) -> NSCollectionLayoutSection? in
// configure cells
}
// adding a header:
if hasHeader {
let header = //...
layout.boundarySupplementaryItems.append(header)
}
return layout
}
Now, I just want to hide the header (animated).
Removing the header can simply be done this way, but this is not animated:
collectionView.collectionViewLayout = createLayout(hasHeader: false)
Is there any other possibility to hide it animated?