Keine Beschreibung

TAPageControl.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // TAPageControl.h
  3. // TAPageControl
  4. //
  5. // Created by Tanguy Aladenise on 2015-01-21.
  6. // Copyright (c) 2015 Tanguy Aladenise. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @protocol TAPageControlDelegate;
  10. @interface TAPageControl : UIControl
  11. /**
  12. * Dot view customization properties
  13. */
  14. /**
  15. * The Class of your custom UIView, make sure to respect the TAAbstractDotView class.
  16. */
  17. @property (nonatomic) Class dotViewClass;
  18. /**
  19. * UIImage to represent a dot.
  20. */
  21. @property (nonatomic) UIImage *dotImage;
  22. /**
  23. * UIImage to represent current page dot.
  24. */
  25. @property (nonatomic) UIImage *currentDotImage;
  26. /**
  27. * Dot size for dot views. Default is 8 by 8.
  28. */
  29. @property (nonatomic) CGSize dotSize;
  30. @property (nonatomic, strong) UIColor *dotColor;
  31. /**
  32. * Spacing between two dot views. Default is 8.
  33. */
  34. @property (nonatomic) NSInteger spacingBetweenDots;
  35. /**
  36. * Page control setup properties
  37. */
  38. /**
  39. * Delegate for TAPageControl
  40. */
  41. @property(nonatomic,assign) id<TAPageControlDelegate> delegate;
  42. /**
  43. * Number of pages for control. Default is 0.
  44. */
  45. @property (nonatomic) NSInteger numberOfPages;
  46. /**
  47. * Current page on which control is active. Default is 0.
  48. */
  49. @property (nonatomic) NSInteger currentPage;
  50. /**
  51. * Hide the control if there is only one page. Default is NO.
  52. */
  53. @property (nonatomic) BOOL hidesForSinglePage;
  54. /**
  55. * Let the control know if should grow bigger by keeping center, or just get longer (right side expanding). By default YES.
  56. */
  57. @property (nonatomic) BOOL shouldResizeFromCenter;
  58. /**
  59. * Return the minimum size required to display control properly for the given page count.
  60. *
  61. * @param pageCount Number of dots that will require display
  62. *
  63. * @return The CGSize being the minimum size required.
  64. */
  65. - (CGSize)sizeForNumberOfPages:(NSInteger)pageCount;
  66. @end
  67. @protocol TAPageControlDelegate <NSObject>
  68. @optional
  69. - (void)TAPageControl:(TAPageControl *)pageControl didSelectPageAtIndex:(NSInteger)index;
  70. @end