Просто добавьте это в UICollectionView
delegate
метод willDisplaySupplementaryView
view.layer.zPosition
в ноль
public func collectionView(_ collectionView: UICollectionView, willDisplaySupplementaryView view: UICollectionReusableView, forElementKind elementKind: String, at indexPath: IndexPath)
{
if (elementKind == UICollectionElementKindSectionHeader) {
view.layer.zPosition = 0
}
}