Assuming I have a UICollectionview with sections and items. For each section I generate a header as the code below.
Question: How do I add a top header view to the collectionView itself which is different than the section header demonstrate below (using objective-c, IB, Auto Layouts)
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
UICollectionReusableView *reusableview = nil;
if (kind == UICollectionElementKindSectionHeader) {
HeaderCollectionReusableView *headerView = [self.collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header" forIndexPath:indexPath];
headerView.label1.text = "This is a section title";
reusableview = headerView;
}
return reusableview;
}
