Brak opisu

UIView+WZLBadge.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // UIView+WZLBadge.h
  3. // WZLBadgeDemo
  4. //
  5. // Created by zilin_weng on 15/6/24.
  6. // Copyright (c) 2015年 Weng-Zilin. All rights reserved.
  7. // Project description: this is a solution to enable any UIView to display badge
  8. #import <UIKit/UIKit.h>
  9. #import "WZLBadgeProtocol.h"
  10. #pragma mark -- badge apis
  11. @interface UIView (WZLBadge)<WZLBadgeProtocol>
  12. /**
  13. * show badge with red dot style and WBadgeAnimTypeNone by default.
  14. */
  15. - (void)showBadge;
  16. /**
  17. * showBadge
  18. *
  19. * @param style WBadgeStyle type
  20. * @param value (if 'style' is WBadgeStyleRedDot or WBadgeStyleNew,
  21. this value will be ignored. In this case, any value will be ok.)
  22. * @param aniType
  23. */
  24. - (void)showBadgeWithStyle:(WBadgeStyle)style
  25. value:(NSInteger)value
  26. animationType:(WBadgeAnimType)aniType;
  27. /*
  28. wBadgeStyle default is WBadgeStyleNumber
  29. */
  30. - (void)showNumberBadgeWithValue:(NSInteger)value
  31. animationType:(WBadgeAnimType)aniType;
  32. // wBadgeStyle default is WBadgeStyleNumber ;
  33. // WBadgeAnimType defualt is WBadgeAnimTypeNone
  34. - (void)showNumberBadgeWithValue:(NSInteger)value;
  35. /**
  36. * clear badge(hide badge)
  37. */
  38. - (void)clearBadge;
  39. /**
  40. * make bage(if existing) not hiden
  41. */
  42. - (void)resumeBadge;
  43. @end