CGXVerticalMenuRoundFlowLayout.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // CGXVerticalMenuRoundFlowLayout.h
  3. // CGXVerticalMenuView-OC
  4. //
  5. // Created by CGX on 2018/05/01.
  6. // Copyright © 2019 CGX. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "CGXVerticalMenuRoundModel.h"
  10. #import "CGXVerticalMenuRoundLayoutAttributes.h"
  11. #import "CGXVerticalMenuRoundReusableView.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. @protocol CGXVerticalMenuRoundFlowLayoutDelegate <UICollectionViewDelegateFlowLayout>
  14. @required
  15. @optional
  16. /// 设置底色参数
  17. /// @param collectionView collectionView description
  18. /// @param section section description
  19. - (CGXVerticalMenuRoundModel *)collectionView:(UICollectionView *)collectionView configModelForSectionAtIndex:(NSInteger)section;
  20. /// 设置底色偏移点量(与collectionview的sectionInset用法相同,但是与sectionInset区分)
  21. /// @param collectionView collectionView description
  22. /// @param section section description
  23. - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView borderEdgeInsertsForSectionAtIndex:(NSInteger)section;
  24. /// 设置是否计算headerview(根据section判断是否单独计算)
  25. /// @param collectionView collectionView description
  26. /// @param section section description
  27. - (BOOL)collectionView:(UICollectionView *)collectionView isCalculateHeaderViewIndex:(NSInteger)section;
  28. /// 设置是否计算footerview(根据section判断是否单独计算)
  29. /// @param collectionView collectionView description
  30. /// @param section section description
  31. - (BOOL)collectionView:(UICollectionView *)collectionView isCalculateFooterViewIndex:(NSInteger)section;
  32. /// 背景图点击事件
  33. /// @param collectionView collectionView description
  34. /// @param indexPath 点击背景图的indexPath
  35. - (void)collectionView:(UICollectionView *)collectionView didSelectDecorationViewAtIndexPath:(NSIndexPath *)indexPath;
  36. /*
  37. 是否悬停
  38. */
  39. - (BOOL)collectionView:(UICollectionView *)collectionView sectionHeadersPinAtSection:(NSInteger)section;
  40. /*
  41. 悬停上部距离
  42. */
  43. - (CGFloat)collectionView:(UICollectionView *)collectionView sectionHeadersPinTopSpaceAtSection:(NSInteger)section;
  44. @end
  45. @interface CGXVerticalMenuRoundFlowLayout : UICollectionViewFlowLayout
  46. /// 是否开始Round计算,(默认YES),当该位置为NO时,计算模块都不开启,包括设置的代理
  47. @property (assign, nonatomic) BOOL isRoundEnabled;
  48. /// 是否计算header(若实现collectionView: layout: isCalculateHeaderViewIndex:)该字段不起作用
  49. @property (assign, nonatomic) BOOL isCalculateHeader;
  50. /// 是否计算footer(若实现collectionView: layout: isCalculateFooterViewIndex:)该字段不起作用
  51. @property (assign, nonatomic) BOOL isCalculateFooter;
  52. /// 是否使用不规则Cell大小的计算方式(若Cell的大小是相同固定大小,则无需开启该方法),默认NO
  53. @property (assign, nonatomic) BOOL isCalculateOpenIrregularCell;
  54. @property (nonatomic, strong,readonly) NSArray <UICollectionViewLayoutAttributes *> *sectionHeaderAttributes;
  55. @end
  56. NS_ASSUME_NONNULL_END