Files
yinmeng-ios-store/yinmeng-ios/yinmeng-ios/Base/UIButton/UIButton+EnlargeTouchArea.h
2023-11-23 16:24:18 -08:00

43 lines
1.1 KiB
Objective-C

//
// UIButton+EnlargeTouchArea.h
// yinmeng-ios
//
// Created by 触海 on 2023/11/22.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIButton (EnlargeTouchArea)
@property (nonatomic, assign) NSTimeInterval yn_acceptEventInterval; // 重复点击的间隔
//图片frmae
@property (strong, nonatomic) NSValue *imageFrame;
//标题frmae
@property (strong, nonatomic) NSValue *titleFrame;
/**
通过 hitTest:withEvent: 扩大btn的点击范围
注:填写的都是 在button 原frame 上面 扩大的对应的值
@param top 顶部 扩大的值
@param right 右边 扩大的值
@param bottom 底部 扩大的值
@param left 左边 扩大的值
*/
- (void)setEnlargeEdgeWithTop:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom left:(CGFloat)left;
/**
扩大按钮点击范围
@discussion setEnlargeEdgeWithTop:right:bottom:left:方法的包装
*/
- (void)enlargeTouchArea:(UIEdgeInsets)insets;
+(UIButton *)buttonInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor image:(UIImage *)image bgImage:(UIImage *)bgImage;
@end
NS_ASSUME_NONNULL_END