WMZBannerConfig.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. #import "UIImageView+WebCache.h"
  11. #import <UIKit/UIKit.h>
  12. #define BannerWitdh [UIScreen mainScreen].bounds.size.width
  13. #define BannerHeight [UIScreen mainScreen].bounds.size.height
  14. #define BannerWeakSelf(obj) __weak typeof(obj) weakObject = obj;
  15. #define BannerStrongSelf(obj) __strong typeof(obj) strongObject = weakObject;
  16. #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]
  17. #define WMZBannerPropStatementAndPropSetFuncStatement(propertyModifier,className, propertyPointerType, propertyName) \
  18. @property(nonatomic,propertyModifier)propertyPointerType propertyName; \
  19. - (className * (^) (propertyPointerType propertyName)) propertyName##Set;
  20. #define WMZBannerPropSetFuncImplementation(className, propertyPointerType, propertyName) \
  21. - (className * (^) (propertyPointerType propertyName))propertyName##Set{ \
  22. return ^(propertyPointerType propertyName) { \
  23. _##propertyName = propertyName; \
  24. return self; \
  25. }; \
  26. }
  27. /*
  28. * cell的block
  29. */
  30. typedef UICollectionViewCell* (^BannerCellCallBlock)(NSIndexPath *indexPath,UICollectionView* collectionView,id model,UIImageView* bgImageView,NSArray*dataArr);
  31. /*
  32. * 点击
  33. */
  34. typedef void (^BannerClickBlock)(id anyID,NSInteger index);
  35. /*
  36. * 自定义pageControl
  37. */
  38. typedef void (^BannerPageControl)(UIPageControl* pageControl);
  39. /*
  40. * 点击 ,可获取居中cell
  41. */
  42. typedef void (^BannerCenterClickBlock)(id anyID,NSInteger index,BOOL isCenter,UICollectionViewCell* cell);
  43. /*
  44. * 滚动结束
  45. */
  46. typedef void (^BannerScrollEndBlock)(id anyID,NSInteger index,BOOL isCenter,UICollectionViewCell* cell);
  47. /*
  48. * 自定义下划线
  49. */
  50. typedef void (^BannerSpecialLine)(UIView *line);
  51. /*
  52. *cell动画的位置
  53. */
  54. typedef enum :NSInteger{
  55. BannerCellPositionCenter = 0, //居中 默认
  56. BannerCellPositionBottom = 1, //置底
  57. }BannerCellPosition;
  58. /*
  59. *特殊样式
  60. */
  61. typedef enum :NSInteger{
  62. SpecialStyleLine = 1, //下划线
  63. }SpecialStyle;
  64. /*
  65. *pageControl的位置
  66. */
  67. typedef enum :NSInteger{
  68. BannerControlCenter = 0, //居中 默认
  69. BannerControlLeft = 1, //左下
  70. BannerControlRight = 2, //右下
  71. }BannerControlPosition;
  72. #endif /* WMZBannerConfig_h */