ZZCarousel.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //
  2. // ZZCarousel.h
  3. // Ace
  4. //
  5. // Created by AceZZ on 15/9/7.
  6. // Copyright (c) 2015年 cscmh. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. /*
  10. * 用于显示轮播中内容的View
  11. */
  12. @interface ZZCarouselView : UICollectionViewCell
  13. @property (strong, nonatomic) UIImageView *imageView;
  14. //@property (strong, nonatomic) UILabel *title;
  15. @end
  16. @interface ZZCarouselPageControlOfNumber : UIView
  17. @property (assign,nonatomic) NSInteger currentPage;
  18. @property (strong,nonatomic) UILabel *pageControl;
  19. @end
  20. /*
  21. * delegate
  22. */
  23. @class ZZCarousel;
  24. @protocol ZZCarouselDelegate <NSObject>
  25. @required
  26. /*
  27. * 此方法为 ZZCarousel 轮播内容的数量
  28. */
  29. - (NSInteger)numberOfZZCarousel:(ZZCarousel *)wheel;
  30. /*
  31. * 此方法为 用于ZZCarousel 轮播内容的显示
  32. */
  33. - (ZZCarouselView *)zzcarousel:(UICollectionView *)zzcarousel viewForItemAtIndex:(NSIndexPath*)index itemsIndex:(NSInteger)itemsIndex identifire:(NSString *)identifire ZZCarousel:(ZZCarousel*)zZCarousel;
  34. @optional
  35. /*
  36. * 此方法为 用于ZZCarousel 轮播的点击方法
  37. */
  38. - (void)zzcarouselScrollView:(ZZCarousel *)zzcarouselScrollView didSelectItemAtIndex:(NSInteger)index;
  39. @end
  40. typedef NS_ENUM(NSInteger, ZZCarouselPageType)
  41. {
  42. ZZCarouselPageTypeOfNone, //默认系统 UIPageControl 样式
  43. ZZCarouselPageTypeOfNumber, //自定义熟数字样式 PageControl
  44. };
  45. @interface ZZCarousel : UIView
  46. @property (nonatomic, weak) id<ZZCarouselDelegate> delegate;
  47. @property (nonatomic, assign) CGFloat carouseScrollTimeInterval;
  48. @property (nonatomic, readonly) NSInteger numberOfItems;
  49. /*
  50. * 设置系统默认 UIPageControl 的位置、 背景颜色 、指示器顶层颜色 、指示器底层颜色
  51. */
  52. @property (nonatomic, assign) CGRect pageControlFrame;
  53. //两种样式的PageControl 共用背景颜色的属性
  54. @property (nonatomic, strong) UIColor *pageControlBackGroundColor;
  55. @property (nonatomic, strong) UIColor *pageIndicatorTintColor;
  56. @property (nonatomic, strong) UIColor *currentPageIndicatorTintColor;
  57. @property (nonatomic, assign) NSInteger pageControlOfNumberCurrentTotal;
  58. /*
  59. * 当PageControl 为显示数字类型时 有如下属性
  60. */
  61. //设置数字类型 PageControl 的字体
  62. @property (nonatomic, strong) UIFont *pageControlOfNumberFont;
  63. @property (nonatomic, strong) UIColor *pageContolOfNumberFontColor;
  64. //设置是否使用自动滚动
  65. @property (nonatomic, assign) BOOL isAutoScroll;
  66. @property (nonatomic, assign) ZZCarouselPageType pageType;
  67. /*
  68. * 重用方法
  69. */
  70. -(void)reloadData;
  71. @end