I have two sections in UICollectionView. I want to show a section header in UICollectionView for only 1st section. Not in 0th section.
So I
In my case I have given inset to sections so it was giving me empty space So if you have implemented following method, do it in below way
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
if {
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}else{
return UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
}
}