UIBarButtonItem+FLEX.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // UIBarButtonItem+FLEX.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 2/4/20.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #define FLEXBarButtonItemSystem(item, tgt, sel) \
  10. [UIBarButtonItem flex_systemItem:UIBarButtonSystemItem##item target:tgt action:sel]
  11. @interface UIBarButtonItem (FLEX)
  12. @property (nonatomic, readonly, class) UIBarButtonItem *flex_flexibleSpace;
  13. @property (nonatomic, readonly, class) UIBarButtonItem *flex_fixedSpace;
  14. + (instancetype)flex_itemWithCustomView:(UIView *)customView;
  15. + (instancetype)flex_backItemWithTitle:(NSString *)title;
  16. + (instancetype)flex_systemItem:(UIBarButtonSystemItem)item target:(id)target action:(SEL)action;
  17. + (instancetype)flex_itemWithTitle:(NSString *)title target:(id)target action:(SEL)action;
  18. + (instancetype)flex_doneStyleitemWithTitle:(NSString *)title target:(id)target action:(SEL)action;
  19. + (instancetype)flex_itemWithImage:(UIImage *)image target:(id)target action:(SEL)action;
  20. + (instancetype)flex_disabledSystemItem:(UIBarButtonSystemItem)item;
  21. + (instancetype)flex_disabledItemWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style;
  22. + (instancetype)flex_disabledItemWithImage:(UIImage *)image;
  23. /// @return the receiver
  24. - (UIBarButtonItem *)flex_withTintColor:(UIColor *)tint;
  25. - (void)_setWidth:(CGFloat)width;
  26. @end