#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, JKButtonEdgeInsetsStyle) {
JKButtonEdgeInsetsStyleTop, // image在上,label在下
JKButtonEdgeInsetsStyleLeft, // image在左,label在右
JKButtonEdgeInsetsStyleBottom, // image在下,label在上
JKButtonEdgeInsetsStyleRight // image在右,label在左
};
@interface UIButton (JKImageTitleSpacing)
+ (UIButton *)buttonWithTitle:(NSString *)title ImageName:(NSString *)imageName ButtonEdgeInsetsStyle:(JKButtonEdgeInsetsStyle)edgeInsetsStyle Frame:(CGRect)frame actionBlock:(void(^)(UIButton *sender))actionBlock;
@end
#import "UIButton+JKImageTitleSpacing.h"
typedef void (^ActionBlock)(UIButton *);
@implementation UIButton (JKImageTitleSpacing)
static ActionBlock _actionBlock;
+ (UIButton *)buttonWithTitle:(NSString *)title
ImageName:(NSString *)imageName
ButtonEdgeInsetsStyle:(JKButtonEdgeInsetsStyle)edgeInsetsStyle
Frame:(CGRect)frame
actionBlock: