UICollectionView
has a SupplementaryView
.
You can register a view with
- (void)registerClass:(Class)viewClass forSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier;
- (void)registerNib:(UINib *)nib forSupplementaryViewOfKind:(NSString *)kind withReuseIdentifier:(NSString *)identifier;
and use with :
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
If you want a fixed header like UITableViewStylePain
, check the below link.
How to make Supplementary View float in UICollectionView as Section Headers do in UITableView plain style