口袋优选

LPPageVC.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //
  2. // LPPageVC.h
  3. // LPNavPageVCTest
  4. //
  5. // Created by LPDev on 16/4/19.
  6. // Copyright © 2016年 anonymous. All rights reserved.
  7. //
  8. #import "LPBaseVC.h"
  9. #import "KBBaseViewController.h"
  10. @class LPPageVC;
  11. #pragma LPPageVCEditMode - edit的状态
  12. typedef NS_ENUM(NSInteger, LPPageVCEditMode) {
  13. LPPageVCEditModeDefault = 0,
  14. LPPageVCEditModeEditing
  15. };
  16. #pragma LPPageVCSegmentStyle - segment的样式
  17. typedef NS_ENUM(NSInteger, LPPageVCSegmentStyle) {
  18. LPPageVCSegmentStyleDefault = 0,
  19. LPPageVCSegmentStyleLineHighlight
  20. };
  21. /**
  22. * LPPageVCDataSource
  23. */
  24. @protocol LPPageVCDataSource <NSObject>
  25. #pragma LPPageVCDataSource - 设置点击pageVCIndex的vc
  26. - (UIViewController *)pageVC:(LPPageVC *)pageVC viewControllerAtIndex:(NSInteger)index;
  27. #pragma LPPageVCDataSource - 设置点击pageVCIndex的title
  28. - (NSString *)pageVC:(LPPageVC *)pageVC titleAtIndex:(NSInteger)index;
  29. #pragma LPPageVCDataSource - 设置栏目的个数
  30. - (NSInteger)numberOfContentForPageVC:(LPPageVC *)pageVC;
  31. @end
  32. /**
  33. * LPPageVCDelegate
  34. */
  35. @protocol LPPageVCDelegate <NSObject>
  36. @optional // 不一定需要实现以下方法
  37. #pragma LPPageVCDelegate - 将要改变到index
  38. - (void)pageVC:(LPPageVC *)pageVC willChangeToIndex:(NSInteger)toIndex fromIndex:(NSInteger)fromIndex;
  39. #pragma LPPageVCDelegate - 已经改变到index
  40. - (void)pageVC:(LPPageVC *)pageVC didChangeToIndex:(NSInteger)toIndex fromIndex:(NSInteger)fromIndex;
  41. #pragma LPPageVCDelegate - 在index处已点击 - 此方法暂时不使用
  42. - (void)pageVC:(LPPageVC *)pageVC didClickAtIndex:(NSUInteger)index;
  43. #pragma LPPageVCDelegate - 点击Edit按钮的mode
  44. - (void)pageVC:(LPPageVC *)pageVC didClickEditMode:(LPPageVCEditMode)mode;
  45. @end
  46. @interface LPPageVC : KBBaseViewController {
  47. UIScrollView * _contentScrollView;
  48. UIScrollView * _segmentScrollView;
  49. }
  50. @property (nonatomic, weak) id <LPPageVCDataSource> dataSource;
  51. @property (nonatomic, weak) id <LPPageVCDelegate> delegate;
  52. @property (nonatomic, assign) LPPageVCSegmentStyle segmentStyle;
  53. @property (nonatomic, strong) UIColor * normalTextColor;
  54. @property (nonatomic, strong) UIColor * higlightTextColor;
  55. @property (nonatomic, strong) UIColor * lineBackground;
  56. @property (nonatomic, strong) NSMutableArray * labelArr;//标题的数组
  57. @property (nonatomic, strong) UIView * bottomLine;
  58. #pragma mark - means
  59. // 刷新数据
  60. - (void)reloadData;
  61. // 刷新一个具体的栏目
  62. - (void)reloadDataAtIndex:(NSUInteger)index;
  63. // 根据index获取对应的vc
  64. - (UIViewController *)viewControllerAtIndex:(NSUInteger)index;
  65. //设置选中的栏目
  66. - (void)setSelectedIndex:(NSInteger)index;
  67. @end