SQCustomButton.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // SQCustomButton.h
  3. // SQCustomButton
  4. //
  5. // Created by yangsq on 2017/9/12.
  6. // Copyright © 2017年 yangsq. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NS_ENUM(NSInteger,SQCustomButtonType) {
  11. SQCustomButtonLeftImageType,//左图标,右文字
  12. SQCustomButtonTopImageType,//上图标,下文字
  13. SQCustomButtonRightImageType//右图标,左文字
  14. };
  15. @interface SQCustomButton : UIView
  16. @property (nonatomic, strong) UIImageView *imageView;
  17. @property (nonatomic, strong) UILabel *titleLabel;
  18. @property (nonatomic, assign) BOOL isShowSelectBackgroudColor;//是否展示点击效果
  19. @property (nonatomic, copy)void(^touchBlock)(SQCustomButton *button);
  20. /*
  21. 初始化
  22. imageSize 图标大小
  23. isAutoWidth 是否根据文字长度自适应
  24. */
  25. - (id)initWithFrame:(CGRect)frame
  26. type:(SQCustomButtonType)type
  27. imageSize:(CGSize)imageSize
  28. midmargin:(CGFloat)midmargin;
  29. //点击响应
  30. - (void)touchAction:(void(^)(SQCustomButton *button))block;
  31. NS_ASSUME_NONNULL_END
  32. @end