BYHLabelsLayout.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // BYHLabelsLayout.h
  3. // UICollectionVIewDemo
  4. //
  5. // Created by 疯叶 on 2019/8/14.
  6. // Copyright © 2019 疯叶. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @protocol BYHLabelsLayoutDelegate;
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface BYHLabelsLayout : UICollectionViewLayout
  12. @property (nonatomic,weak) id<BYHLabelsLayoutDelegate> delegate;
  13. @end
  14. @protocol BYHLabelsLayoutDelegate <NSObject>
  15. @required
  16. - (CGSize)collectionView:(UICollectionView *)collectionView layout:(BYHLabelsLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
  17. @optional
  18. /**
  19. * 行间距
  20. */
  21. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BYHLabelsLayout *)layout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
  22. /**
  23. * 列间距
  24. */
  25. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BYHLabelsLayout *)layout minimumLineSpacingForSectionAtIndex:(NSInteger)section;
  26. /**
  27. * section边距
  28. */
  29. - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(BYHLabelsLayout *)layout insetForSectionAtIndex:(NSInteger)section;
  30. /**
  31. * 头部高度
  32. */
  33. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BYHLabelsLayout *)layout referenceHeightForHeaderInSection:(NSInteger)section;
  34. /**
  35. * 尾部高度
  36. */
  37. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(BYHLabelsLayout *)layout referenceHeightForFooterInSection:(NSInteger)section;
  38. @end
  39. NS_ASSUME_NONNULL_END