TYTabPagerController.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // TYTabPagerController.h
  3. // TYPagerControllerDemo
  4. //
  5. // Created by tanyang on 16/5/3.
  6. // Copyright © 2016年 tanyang. All rights reserved.
  7. //
  8. #import "TYPagerController.h"
  9. @class TYTabPagerController;
  10. @protocol TYTabPagerControllerDelegate <TYPagerControllerDelegate>
  11. @optional
  12. // configre collectionview cell
  13. - (void)pagerController:(TYTabPagerController *)pagerController configreCell:(UICollectionViewCell *)cell forItemTitle:(NSString *)title atIndexPath:(NSIndexPath *)indexPath;
  14. // did select indexPath
  15. - (void)pagerController:(TYTabPagerController *)pagerController didSelectAtIndexPath:(NSIndexPath *)indexPath;
  16. // did scroll to page index
  17. - (void)pagerController:(TYTabPagerController *)pagerController didScrollToTabPageIndex:(NSInteger)index;
  18. // transition frome cell to cell with animated
  19. - (void)pagerController:(TYTabPagerController *)pagerController transitionFromeCell:(UICollectionViewCell *)fromCell toCell:(UICollectionViewCell *)toCell animated:(BOOL)animated;
  20. // transition frome cell to cell with progress
  21. - (void)pagerController:(TYTabPagerController *)pagerController transitionFromeCell:(UICollectionViewCell *)fromCell toCell:(UICollectionViewCell *)toCell progress:(CGFloat)progress;
  22. @end
  23. typedef NS_ENUM(NSUInteger, TYPagerBarStyle) {
  24. TYPagerBarStyleNoneView,
  25. TYPagerBarStyleProgressView,
  26. TYPagerBarStyleProgressBounceView,
  27. TYPagerBarStyleCoverView
  28. };
  29. @interface TYTabPagerController : TYPagerController
  30. #pragma clang diagnostic push
  31. #pragma clang diagnostic ignored"-Wobjc-property-synthesis"
  32. @property (nonatomic, weak) id<TYTabPagerControllerDelegate> delegate;
  33. #pragma clang diagnostic pop
  34. // view ,don't change frame
  35. @property(nonatomic, strong) UIImageView *bgTopImgView;
  36. @property (nonatomic, strong) UIView *pagerBarView; // pagerBarView height is contentTopEdging
  37. @property (nonatomic, weak, readonly) UICollectionView *collectionViewBar;
  38. @property(nonatomic, assign) CGFloat kCollectionViewBarHieght;
  39. @property (nonatomic, weak, readonly) UIView *progressView;
  40. @property (nonatomic, assign) TYPagerBarStyle barStyle; // you can set or ovrride barStyle
  41. @property (nonatomic, assign) CGFloat collectionLayoutEdging; // collectionLayout left right edging
  42. // progress view
  43. @property (nonatomic, assign) CGFloat progressHeight;
  44. @property (nonatomic, assign) CGFloat progressEdging; // if < 0 width + edge ,if >0 width - edge
  45. @property (nonatomic, assign) CGFloat progressWidth; //if>0 progress width is equal,else progress width is cell width
  46. // cell
  47. @property (nonatomic, assign) CGFloat cellWidth; // if>0 cells width is equal,else if=0 cell will caculate all titles width
  48. @property (nonatomic, assign) CGFloat cellSpacing; // cell space
  49. @property (nonatomic, assign) CGFloat cellEdging; // cell left right edge
  50. // animate duration
  51. @property (nonatomic, assign) CGFloat animateDuration;
  52. // text font
  53. @property (nonatomic, strong) UIFont *normalTextFont;
  54. @property (nonatomic, strong) UIFont *selectedTextFont;
  55. // if you custom cell ,you must register cell
  56. - (void)registerCellClass:(Class)cellClass isContainXib:(BOOL)isContainXib;
  57. @end