UITabBarItem+WZLBadge.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // UITabBarItem+WZLBadge.h
  3. // WZLBadgeDemo
  4. //
  5. // Created by zilin_weng on 15/9/24.
  6. // Copyright (c) 2015年 Weng-Zilin. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "UIView+WZLBadge.h"
  10. #import "WZLBadgeProtocol.h"
  11. @interface UITabBarItem (WZLBadge)<WZLBadgeProtocol>
  12. @property (nonatomic, strong) UILabel *badge; /* badge entity, which is adviced not to set manually */
  13. @property (nonatomic, strong) UIColor *badgeBgColor; /* red color by default if not set */
  14. @property (nonatomic, strong) UIColor *badgeTextColor; /* white color by default if not set */
  15. @property (nonatomic, assign) CGRect badgeFrame; /* we have optimized the badge frame and center.
  16. This property is adviced not to set manually */
  17. @property (nonatomic, assign) CGPoint badgeCenterOffset;/* offset from right-top corner. {0,0} by default */
  18. /* For x, negative number means left offset
  19. For y, negative number means bottom offset
  20. */
  21. @property (nonatomic, assign) WBadgeAnimType aniType; /* NOTE that this is not animation type of badge's
  22. appearing, nor hidding*/
  23. @property (nonatomic, assign) NSInteger badgeMaximumBadgeNumber; /*for WBadgeStyleNumber style badge,
  24. if badge value is above badgeMaximumBadgeNumber,
  25. "badgeMaximumBadgeNumber+" will be printed. */
  26. /**
  27. * show badge with red dot style and WBadgeAnimTypeNone by default.
  28. */
  29. - (void)showBadge;
  30. /**
  31. * showBadge
  32. *
  33. * @param style WBadgeStyle type
  34. * @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
  35. this value will be ignored. In this case, any value will be ok.)
  36. * @param aniType
  37. */
  38. - (void)showBadgeWithStyle:(WBadgeStyle)style
  39. value:(NSInteger)value
  40. animationType:(WBadgeAnimType)aniType;
  41. /**
  42. * clear badge(hide badge)
  43. */
  44. - (void)clearBadge;
  45. /**
  46. * make bage(if existing) not hiden
  47. */
  48. - (void)resumeBadge;
  49. @end