猎豆优选

DCTitleRolling.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // DCTitleRolling.h
  3. // CDDTitleRolling
  4. //
  5. // Created by dashen on 2017/11/17.
  6. //Copyright © 2017年 com.RocketsChen. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. // 每条几组数据
  10. typedef enum : NSUInteger {
  11. CDDRollingOneGroup , // 默认一种(类似京东、国美)
  12. CDDRollingTwoGroup, // 两种(类似淘宝)
  13. } CDDRollingGroupStyle;
  14. @protocol CDDRollingDelegate<NSObject>
  15. - (void)dc_RollingViewSelectWithActionAtIndex:(NSInteger)index;
  16. @end
  17. @interface DCTitleRolling : UIView
  18. /** 点击代理 */
  19. @property (nonatomic , assign) id<CDDRollingDelegate>delegate;
  20. /** 更多点击回调 */
  21. @property (nonatomic, copy) dispatch_block_t moreClickBlock;
  22. /* 图片 */
  23. @property (strong , nonatomic)UIImageView *leftImageView;
  24. /* 按钮 */
  25. @property (strong , nonatomic)UIButton *rightButton;
  26. /**
  27. 数据
  28. *leftImage 左边图片
  29. *rolTitles 标题数组
  30. *rolTags tag数组
  31. *rightImages 右边图片数组
  32. *rightbuttonTitle 右边按钮(支持点击回调)
  33. *interval 定时器滚动间隔
  34. *rollingTime 滚动一次时间的长短
  35. *titleFont 标题尺寸
  36. *titleColor 标题颜色
  37. *isShowTagBorder 是否展示tag标题边框(默认不)
  38. @param frame 滚动标题的frame
  39. @param titleDataBlock 设置滚动内部的数据
  40. @return 数据展示
  41. */
  42. - (instancetype)initWithFrame:(CGRect)frame WithTitleData:(void(^)(CDDRollingGroupStyle *rollingGroupStyle, NSString **leftImage,NSArray **rolTitles,NSArray **rolTags,NSArray **rightImages,NSString **rightbuttonTitle,NSInteger *interval,float *rollingTime,NSInteger *titleFont,UIColor **titleColor,BOOL *isShowTagBorder))titleDataBlock;
  43. /**
  44. 开始滚动
  45. */
  46. - (void)dc_beginRolling;
  47. /**
  48. 结束滚动
  49. */
  50. - (void)dc_endRolling;
  51. @end