CGXVerticalMenuTitleView.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // CGXVerticalMenuTitleView.h
  3. // CGXVerticalMenuView-OC
  4. //
  5. // Created by CGX on 2018/05/01.
  6. // Copyright © 2019 CGX. All rights reserved.
  7. //
  8. #import "CGXVerticalMenuBaseView.h"
  9. #import "CGXVerticalMenuTitleModel.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @class CGXVerticalMenuTitleView;
  12. @protocol CGXVerticalMenuTitleViewDelegate <NSObject>
  13. @optional
  14. /**
  15. 点击选中的情况才会调用该方法
  16. @param categoryView categoryView description
  17. @param index 选中的index
  18. */
  19. - (void)verticalMenuTitleView:(CGXVerticalMenuTitleView *)categoryView didClickSelectedItemAtIndex:(NSInteger)index;
  20. /**
  21. 滚动选中的情况才会调用该方法
  22. @param categoryView categoryView description
  23. @param index 选中的index
  24. */
  25. - (void)verticalMenuTitleView:(CGXVerticalMenuTitleView *)categoryView didScrollerSelectedItemAtIndex:(NSInteger)index;
  26. /**
  27. 点击选中、滚动选中的情况才会调用该方法
  28. @param categoryView categoryView description
  29. @param index 选中的index
  30. */
  31. - (void)verticalMenuTitleView:(CGXVerticalMenuTitleView *)categoryView didSelectedItemAtIndex:(NSInteger)index;
  32. /**
  33. 正在滚动中的回调
  34. @param categoryView categoryView对象
  35. @param leftIndex 正在滚动中,相对位置处于左边的index
  36. @param rightIndex 正在滚动中,相对位置处于右边的index
  37. @param ratio 从左往右计算的百分比
  38. */
  39. - (void)verticalMenuTitleView:(CGXVerticalMenuTitleView *)categoryView
  40. scrollingFromLeftIndex:(NSInteger)leftIndex
  41. toRightIndex:(NSInteger)rightIndex
  42. ratio:(CGFloat)ratio;
  43. @end
  44. @interface CGXVerticalMenuTitleView : CGXVerticalMenuBaseView
  45. /**代理方法*/
  46. @property (nonatomic, weak) id<CGXVerticalMenuTitleViewDelegate> delegate;
  47. /**指示器方向 默认左侧*/
  48. @property (nonatomic, assign) CGXCategoryListCellClickedPosition clickedPosition;
  49. /**指示器动画时间 默认0*/
  50. @property (nonatomic, assign) NSTimeInterval timeDuration;
  51. /**
  52. 选中目标index的item
  53. @param index 目标index
  54. */
  55. - (void)selectItemAtIndex:(NSInteger)index;
  56. /**
  57. 滚动目标index的item
  58. @param index 目标index
  59. */
  60. - (void)scrollerItemAtIndex:(NSInteger)index;
  61. @end
  62. NS_ASSUME_NONNULL_END