chiahsien/CHTCollectionViewWaterfallLayout

Can not show header and footer together

cs-joao-souza opened this issue · 1 comments

Header and Footer haven't been shown together and i have know ideia what is going on.

  self.collectionLayout = [[CHTCollectionViewWaterfallLayout alloc] init];
  self.collectionLayout.headerHeight = 50.0f;  
  self.collectionLayout.footerHeight = 120.0f;
  self.collectionLayout.minimumContentHeight = 170.f;
  self.collectionLayout.sectionInset = UIEdgeInsetsMake(0.0f, 21.0f, 10.0f, 21.0f);
  self.collectionLayout.columnCount = 2;
  self.collectionLayout.minimumColumnSpacing = 10.0f;
  self.collectionLayout.minimumInteritemSpacing = 10.0f;
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {

  UICollectionReusableView *reusableview = nil;

  if ([kind isEqualToString:CHTCollectionElementKindSectionHeader]) {
    ColumnistsSectionTitleView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:kColumnistsSectionTitleViewIdentifier forIndexPath:indexPath];
    [headerView setupWithTitle:@"Colunistas do dia"];
    reusableview = headerView;
  } else if ([kind isEqualToString:CHTCollectionElementKindSectionFooter]) {
    ColumnistsSectionFooterView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:kColumnistsSectionFooterViewIdentifier forIndexPath:indexPath];
    [footerView setup];
    [footerView.buttonSeeAll addTarget:self action:@selector(seeAllAction) forControlEvents:UIControlEventTouchUpInside];
    reusableview = footerView;
  }

  return reusableview;
}

I have resisted the both class only header or only footer is shown.

What do i need to do?

Should be fixed.