Files

99 lines
3.0 KiB
C
Raw Permalink Normal View History

2025-08-11 10:43:19 +08:00
/*!
* @header BAKit.h
*
*********************************************************************************
*
* 使BAKit的过程中如果出现bug请及时以以下任意一种方式联系我bug
*
* QQ : ios开发技术群 479663605 (1616137361770)
* : 1616
* Email : 137361770@qq.com
* GitHub : https://github.com/boai
* : http://boaihome.com
*********************************************************************************
*/
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/**
button
- BAKit_ButtonLayoutTypeNormal: button -
- BAKit_ButtonLayoutTypeCenterImageRight: -
- BAKit_ButtonLayoutTypeCenterImageTop: -
- BAKit_ButtonLayoutTypeCenterImageBottom: -
- BAKit_ButtonLayoutTypeLeftImageLeft: -
- BAKit_ButtonLayoutTypeLeftImageRight: -
- BAKit_ButtonLayoutTypeRightImageLeft: -
- BAKit_ButtonLayoutTypeRightImageRight: -
*/
typedef NS_ENUM(NSInteger, BAKit_ButtonLayoutType) {
// 无任何处理
BAKit_ButtonLayoutTypeDefault = 0,
// 系统默认样式
BAKit_ButtonLayoutTypeNormal,
BAKit_ButtonLayoutTypeCenterImageRight,
BAKit_ButtonLayoutTypeCenterImageTop,
BAKit_ButtonLayoutTypeCenterImageBottom,
BAKit_ButtonLayoutTypeLeftImageLeft,
BAKit_ButtonLayoutTypeLeftImageRight,
BAKit_ButtonLayoutTypeRightImageLeft,
BAKit_ButtonLayoutTypeRightImageRight,
};
/**
UIButton block
@param button button
*/
typedef void (^BAKit_UIButtonActionBlock)(UIButton * _Nonnull button);
@interface UIButton (BAKit)
/**
button BAKit_ButtonLayoutTypeNormal ba_button_setBAKit_ButtonLayoutType
*/
@property(nonatomic, assign) BAKit_ButtonLayoutType ba_buttonLayoutType;
/*!
* 0
*/
@property (nonatomic, assign) CGFloat ba_padding;
/*!
* button 5
*/
@property (nonatomic, assign) CGFloat ba_padding_inset;
/**
UIButton block
*/
@property(nonatomic, copy) BAKit_UIButtonActionBlock ba_buttonActionBlock;
#pragma mark - 布局样式 和 间距
/**
UIButton button
@param type button
@param padding
*/
- (void)ba_button_setButtonLayoutType:(BAKit_ButtonLayoutType)type
padding:(CGFloat)padding;
@end
NS_ASSUME_NONNULL_END