// // UIBarButtonItem+Extension.h // JWlive // // Created by pican zhang on 16/3/18. // Copyright © 2016年 pican zhang. All rights reserved. // #import @interface BackView:UIView @property(nonatomic,strong)UIButton *btn; @end @interface UIBarButtonItem (createBtnItem) //+ (instancetype)itemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)target action:(SEL)action; //+ (instancetype)itemWithImage:(NSString *)image // title:(NSString *)title highImage:(NSString *)highImage contentEdge:(UIEdgeInsets)contentEdge target:(id)target action:(SEL)action; //+ (instancetype)itemWithFrame:(CGRect)frame Title:(NSString*)title titleFont:(UIFont*)font titleColor:(UIColor*)titleColor bkgColor:(UIColor*)bkgColor contentEdge:(UIEdgeInsets)contentEdge hasBorder:(BOOL)hasBorder borderBkgColor:(UIColor*)borderBkgColor target:(id)target action:(SEL)action; //+ (instancetype)itemWithFrame:(CGRect)frame Title:(NSString*)title titleFont:(UIFont*)font titleColor:(UIColor*)titleColor target:(id)target action:(SEL)action; //+(UIBarButtonItem *) text:(NSString *)text contentEdge:(UIEdgeInsets)contentEdge selector:(SEL)selecor target:(id)target; ////+(UIBarButtonItem *) text:(NSString *)text selector:(SEL)selecor target:(id)target; //+(UIBarButtonItem *) icon:(NSString *)icon selector:(SEL)selecor target:(id)target; //+(UIBarButtonItem *) back:(NSString *)title selector:(SEL)selecor target:(id)target; // //+(UIBarButtonItem*)itemWithImage:(NSString *)image title:(NSString *)title target:(id)target action:(SEL)action; @end //利用runtime给UIBarButtonItem动态添加属性 @interface UIBarButtonItem (Badge) @property (strong, nonatomic) UIView *badge; @property (assign, nonatomic) UIColor *badgeColor; @property (assign, nonatomic) CGFloat badgeOriginX; @property (assign, nonatomic) CGFloat badgeOriginY; @property (assign, nonatomic) CGFloat badgeSize; // badge width and height @property BOOL hasBadge; @end