Closed dblock closed 10 years ago
Looks good!
breaking backward dep with leadingView and trailingView should probably mean a v.2 release FWIW
@orta those leading trailing views do nothing other than a leading margin. Trailing does nothing.
So where did we fall on this? Good to merge?
me and db paired on it earlier, he might just push new stuff
Cool cool.
Sat down with @orta and rewritten this whole mess using ARCollectionViewMasonryLayoutDelegate
. So now if you want to add a header or a footer, you no longer need to manipulate the layout, you do this on the view-controller.
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
// return a header and/or footer view, must be a UICollectionReusableView
// kind is one of UICollectionElementKindSectionHeader or UICollectionElementKindSectionFooter
UICollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:kind forIndexPath:indexPath];
view.backgroundColor = [UIColor whiteColor];
return view;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(ARCollectionViewMasonryLayout *)collectionViewLayout dimensionForHeaderAtIndexPath:(NSIndexPath *)indexPath
{
return 20; // header length
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(ARCollectionViewMasonryLayout *)collectionViewLayout dimensionForFooterAtIndexPath:(NSIndexPath *)indexPath
{
return 10; // footer length
}
This is ready to merge if green, but needs another code-review.
Cool. Will do.
Looks solid.
This is :green_apple:
Removed
leadingView
andtrailingView
, all these do is adjust margins, we don't use that at Artsy and I don't see how this can be useful. You just say "this is a view from which to take some margin on top or bottom". Bottom does nothing really other than give you some more scroll space. I think it would be useful to be able to insert a random view on top/bottom of the scroll though without having to supply a height and a reusable view, which is https://github.com/AshFurrow/ARCollectionViewMasonryLayout/issues/8.Added optional header in the same vein as the footer via
headerHeight
andheaderViewClass
.Updated documentation.