WMZBannerConfig.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // WMZBannerConfig.h
  3. // WMZBanner
  4. //
  5. // Created by wmz on 2019/9/6.
  6. // Copyright © 2019 wmz. All rights reserved.
  7. //
  8. #ifndef WMZBannerConfig_h
  9. #define WMZBannerConfig_h
  10. #if __has_include(<SDWebImage/UIImageView+WebCache.h>)
  11. #import <SDWebImage/UIImageView+WebCache.h>
  12. #else
  13. #import "UIImageView+WebCache.h"
  14. #endif
  15. #define BANNERCOUNT 500
  16. #define BannerWitdh [UIScreen mainScreen].bounds.size.width
  17. #define BannerHeight [UIScreen mainScreen].bounds.size.height
  18. #define BannerWeakSelf(obj) __weak typeof(obj) weakObject = obj;
  19. #define BannerStrongSelf(obj) __strong typeof(obj) strongObject = weakObject;
  20. #define BannerColor(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  21. #define WMZBannerPropStatementAndPropSetFuncStatement(propertyModifier,className, propertyPointerType, propertyName) \
  22. @property(nonatomic,propertyModifier)propertyPointerType propertyName; \
  23. - (className * (^) (propertyPointerType propertyName)) propertyName##Set;
  24. #define WMZBannerPropSetFuncImplementation(className, propertyPointerType, propertyName) \
  25. - (className * (^) (propertyPointerType propertyName))propertyName##Set{ \
  26. return ^(propertyPointerType propertyName) { \
  27. self->_##propertyName = propertyName; \
  28. return self; \
  29. }; \
  30. }
  31. /*
  32. * cell的block
  33. */
  34. typedef UICollectionViewCell* (^BannerCellCallBlock)(NSIndexPath *indexPath,UICollectionView* collectionView,id model,UIImageView* bgImageView,NSArray*dataArr);
  35. /*
  36. * 点击
  37. */
  38. typedef void (^BannerClickBlock)(id anyID,NSInteger index);
  39. /*
  40. * 自定义pageControl
  41. */
  42. typedef void (^BannerPageControl)(UIControl* pageControl);
  43. /*
  44. * 点击 ,可获取居中cell
  45. */
  46. typedef void (^BannerCenterClickBlock)(id anyID,NSInteger index,BOOL isCenter,UICollectionViewCell* cell);
  47. /*
  48. * 滚动结束
  49. */
  50. typedef void (^BannerScrollEndBlock)(id anyID,NSInteger index,BOOL isCenter,UICollectionViewCell* cell);
  51. /*
  52. * 滚动
  53. */
  54. typedef void (^BannerScrollBlock)(CGPoint point);
  55. /*
  56. * 自定义下划线
  57. */
  58. typedef void (^BannerSpecialLine)(UIView *line);
  59. /*
  60. *cell动画的位置
  61. */
  62. typedef enum :NSInteger{
  63. BannerCellPositionCenter = 0, //居中 默认
  64. BannerCellPositionBottom = 1, //置底
  65. BannerCellPositionTop = 2, //顶部
  66. }BannerCellPosition;
  67. /*
  68. *特殊样式
  69. */
  70. typedef enum :NSInteger{
  71. SpecialStyleLine = 1, //下划线
  72. SpecialStyleFirstScale = 2, //首个变大效果
  73. }SpecialStyle;
  74. /*
  75. *pageControl的位置
  76. */
  77. typedef enum :NSInteger{
  78. BannerControlCenter = 0, //居中 默认
  79. BannerControlLeft = 1, //左下
  80. BannerControlRight = 2, //右下
  81. }BannerControlPosition;
  82. #endif /* WMZBannerConfig_h */