WMZPageLoopView.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // WMZPageLoopView.h
  3. // WMZPageController
  4. //
  5. // Created by wmz on 2019/9/22.
  6. // Copyright © 2019 wmz. All rights reserved.
  7. //
  8. #import "WMZPageConfig.h"
  9. #import "WMZPageNaviBtn.h"
  10. #import "WMZPageParam.h"
  11. #import "WMZPageScroller.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. @protocol WMZPageLoopDelegate <NSObject>
  14. @optional
  15. //选中按钮
  16. - (void)selectBtnWithIndex:(NSInteger)index;
  17. //底部左滑的代理
  18. - (void)pageWithScrollView:(UIScrollView*)scrollView left:(BOOL)left;
  19. //底部左滑结束的代理
  20. - (void)pageScrollEndWithScrollView:(UIScrollView*)scrollView;
  21. //获取子tableview
  22. - (void)setUpSuspension:(UIViewController*)newVC index:(NSInteger)index end:(BOOL)end;
  23. @end
  24. @interface WMZPageLoopView : UIView
  25. //菜单视图
  26. @property(nonatomic,strong)UIScrollView *mainView;
  27. //底部视图
  28. @property(nonatomic,strong)UIScrollView *dataView;
  29. @property(nonatomic,strong)UIButton *lineView;
  30. @property(nonatomic,strong)NSMutableArray *btnArr;
  31. @property(nonatomic,assign)NSInteger currentTitleIndex;
  32. //可能的下一个视图
  33. @property(nonatomic,assign)NSInteger nextPageIndex;
  34. //上一个视图
  35. @property(nonatomic,assign)NSInteger lastPageIndex;
  36. //是否已经处理了生命周期
  37. @property(nonatomic,assign)BOOL hasDealAppearance;
  38. //是否已经运行了完整的生命周期
  39. @property(nonatomic,assign)BOOL hasEndAppearance;
  40. //是否往相反方向滑动
  41. @property(nonatomic,assign)BOOL hasDifferenrDirection;
  42. //当前显示VC
  43. @property(nonatomic,strong)UIViewController *currentVC;
  44. //默认选中
  45. @property(nonatomic,assign)BOOL first;
  46. @property(nonatomic,weak)id <WMZPageLoopDelegate> loopDelegate;
  47. - (instancetype)initWithFrame:(CGRect)frame param:(WMZPageParam*)param;
  48. - (void)scrollToIndex:(NSInteger)newIndex;
  49. //标题动画和scrollview联动
  50. - (void)animalAction:(UIScrollView*)scrollView lastContrnOffset:(CGFloat)lastContentOffset;
  51. //结束动画处理
  52. - (void)endAninamal;
  53. @end
  54. NS_ASSUME_NONNULL_END