UIBarButtonItem+Badge.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // UIBarButtonItem+Badge.h
  3. // therichest
  4. //
  5. // Created by Mike on 2014-05-05.
  6. // Copyright (c) 2014 Valnet Inc. All rights reserved.
  7. //
  8. //
  9. // https://github.com/mikeMTOL/UIBarButtonItem-Badge
  10. //
  11. // SPDX-FileCopyrightText: 2014 Mike, Valnet Inc.
  12. // SPDX-License-Identifier: MIT
  13. #import <UIKit/UIKit.h>
  14. @interface UIBarButtonItem (Badge)
  15. @property (strong, atomic) UILabel *badge;
  16. // Badge value to be display
  17. @property (nonatomic) NSString *badgeValue;
  18. // Badge background color
  19. @property (nonatomic) UIColor *badgeBGColor;
  20. // Badge text color
  21. @property (nonatomic) UIColor *badgeTextColor;
  22. // Badge font
  23. @property (nonatomic) UIFont *badgeFont;
  24. // Padding value for the badge
  25. @property (nonatomic) CGFloat badgePadding;
  26. // Minimum size badge to small
  27. @property (nonatomic) CGFloat badgeMinSize;
  28. // Values for offseting the badge over the BarButtonItem you picked
  29. @property (nonatomic) CGFloat badgeOriginX;
  30. @property (nonatomic) CGFloat badgeOriginY;
  31. // In case of numbers, remove the badge when reaching zero
  32. @property BOOL shouldHideBadgeAtZero;
  33. // Badge has a bounce animation when value changes
  34. @property BOOL shouldAnimateBadge;
  35. @end