|
@@ -13,53 +13,53 @@
|
|
|
@implementation UIBarButtonItem (FLEX)
|
|
@implementation UIBarButtonItem (FLEX)
|
|
|
|
|
|
|
|
+ (UIBarButtonItem *)flex_flexibleSpace {
|
|
+ (UIBarButtonItem *)flex_flexibleSpace {
|
|
|
- return [self systemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
|
|
|
|
|
|
|
+ return [self flex_systemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ (UIBarButtonItem *)flex_fixedSpace {
|
|
+ (UIBarButtonItem *)flex_fixedSpace {
|
|
|
- UIBarButtonItem *fixed = [self systemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
|
|
|
|
|
|
|
+ UIBarButtonItem *fixed = [self flex_systemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
|
|
|
fixed.width = 60;
|
|
fixed.width = 60;
|
|
|
return fixed;
|
|
return fixed;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)systemItem:(UIBarButtonSystemItem)item target:(id)target action:(SEL)action {
|
|
|
|
|
|
|
++ (instancetype)flex_systemItem:(UIBarButtonSystemItem)item target:(id)target action:(SEL)action {
|
|
|
return [[self alloc] initWithBarButtonSystemItem:item target:target action:action];
|
|
return [[self alloc] initWithBarButtonSystemItem:item target:target action:action];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)itemWithCustomView:(UIView *)customView {
|
|
|
|
|
|
|
++ (instancetype)flex_itemWithCustomView:(UIView *)customView {
|
|
|
return [[self alloc] initWithCustomView:customView];
|
|
return [[self alloc] initWithCustomView:customView];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)backItemWithTitle:(NSString *)title {
|
|
|
|
|
- return [self itemWithTitle:title target:nil action:nil];
|
|
|
|
|
|
|
++ (instancetype)flex_backItemWithTitle:(NSString *)title {
|
|
|
|
|
+ return [self flex_itemWithTitle:title target:nil action:nil];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)itemWithTitle:(NSString *)title target:(id)target action:(SEL)action {
|
|
|
|
|
|
|
++ (instancetype)flex_itemWithTitle:(NSString *)title target:(id)target action:(SEL)action {
|
|
|
return [[self alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:target action:action];
|
|
return [[self alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:target action:action];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)doneStyleitemWithTitle:(NSString *)title target:(id)target action:(SEL)action {
|
|
|
|
|
|
|
++ (instancetype)flex_doneStyleitemWithTitle:(NSString *)title target:(id)target action:(SEL)action {
|
|
|
return [[self alloc] initWithTitle:title style:UIBarButtonItemStyleDone target:target action:action];
|
|
return [[self alloc] initWithTitle:title style:UIBarButtonItemStyleDone target:target action:action];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)itemWithImage:(UIImage *)image target:(id)target action:(SEL)action {
|
|
|
|
|
|
|
++ (instancetype)flex_itemWithImage:(UIImage *)image target:(id)target action:(SEL)action {
|
|
|
return [[self alloc] initWithImage:image style:UIBarButtonItemStylePlain target:target action:action];
|
|
return [[self alloc] initWithImage:image style:UIBarButtonItemStylePlain target:target action:action];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)disabledSystemItem:(UIBarButtonSystemItem)system {
|
|
|
|
|
- UIBarButtonItem *item = [self systemItem:system target:nil action:nil];
|
|
|
|
|
|
|
++ (instancetype)flex_disabledSystemItem:(UIBarButtonSystemItem)system {
|
|
|
|
|
+ UIBarButtonItem *item = [self flex_systemItem:system target:nil action:nil];
|
|
|
item.enabled = NO;
|
|
item.enabled = NO;
|
|
|
return item;
|
|
return item;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)disabledItemWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style {
|
|
|
|
|
- UIBarButtonItem *item = [self itemWithTitle:title target:nil action:nil];
|
|
|
|
|
|
|
++ (instancetype)flex_disabledItemWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style {
|
|
|
|
|
+ UIBarButtonItem *item = [self flex_itemWithTitle:title target:nil action:nil];
|
|
|
item.enabled = NO;
|
|
item.enabled = NO;
|
|
|
return item;
|
|
return item;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-+ (instancetype)disabledItemWithImage:(UIImage *)image {
|
|
|
|
|
- UIBarButtonItem *item = [self itemWithImage:image target:nil action:nil];
|
|
|
|
|
|
|
++ (instancetype)flex_disabledItemWithImage:(UIImage *)image {
|
|
|
|
|
+ UIBarButtonItem *item = [self flex_itemWithImage:image target:nil action:nil];
|
|
|
item.enabled = NO;
|
|
item.enabled = NO;
|
|
|
return item;
|
|
return item;
|
|
|
}
|
|
}
|