CCZTrotingView.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // CCZTrotingView.h
  3. // CCZTrotView
  4. //
  5. // Created by 金峰 on 16/9/22.
  6. // Copyright © 2016年 金峰. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSUInteger, CCZTrotDirection) {
  10. CCZTrotDirectionTop,
  11. CCZTrotDirectionBottom,
  12. CCZTrotDirectionLeft, /**< Default*/
  13. CCZTrotDirectionRight,
  14. };
  15. @interface CCZTrotingView : UIView
  16. @property (nonatomic, strong) UIView *leftView;
  17. @property (nonatomic, strong) UIView *rightView;
  18. @property (nonatomic, strong) UIImage *backgroundImage;
  19. @property (nonatomic, strong) UIView *currentTrotView; /**< 当前正在滚动的view*/
  20. @property (nonatomic, strong) UIView *trotContaierView;
  21. @property (nonatomic, assign) CCZTrotDirection direction;
  22. @property (nonatomic, assign) NSTimeInterval duration;
  23. @property (nonatomic, assign) NSTimeInterval pause; /**< 在主页暂停的时间, default is 0*/
  24. @property (nonatomic, assign) BOOL autoTrotingRepeat; /**< Default is NO, auto repeat*/
  25. @property (nonatomic, assign) BOOL isTroting; /**< 是否在滚动*/
  26. @property (nonatomic, assign) BOOL hideWhenStopTroting; /**< 在滚动完成之后隐藏, default is NO*/
  27. /**
  28. 添加需要滚动的view
  29. */
  30. - (void)addTrotView:(UIView *)trotView;
  31. /**
  32. 停止troting
  33. */
  34. - (void)trotingStop:(void(^)())stopBlock;
  35. /**
  36. 开始troting
  37. */
  38. - (void)trotingStart:(void(^)())startBlcok;
  39. /**
  40. 正在troting
  41. */
  42. - (void)troting:(void(^)())trotingBlock;
  43. /**
  44. 主动去执行troting,会重置正在进行的troting
  45. */
  46. - (void)updateTroting;
  47. @end