SwipeButton.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // SwipeButton.h
  3. // SwipeTableView
  4. //
  5. // Created by zhao on 16/8/11.
  6. // Copyright © 2016年 zhaoName. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef void(^TouchSwipeButtonBlock)(void);
  10. @interface SwipeButton : UIButton
  11. @property (nonatomic, strong) TouchSwipeButtonBlock touchBlock;
  12. /**
  13. * 创建左滑或右滑时的button, button只有title没有Image
  14. *
  15. * @param title button的标题
  16. * @param font button的字体大小 默认为15
  17. * @param textColor button的字体颜色 默认黑色
  18. * @param backgroundColor button的背景颜色 默认白色
  19. */
  20. + (SwipeButton *)createSwipeButtonWithTitle:(NSString *)title backgroundColor:(UIColor *)backgroundColor touchBlock:(TouchSwipeButtonBlock)block;
  21. + (SwipeButton *)createSwipeButtonWithTitle:(NSString *)title font:(CGFloat)font textColor:(UIColor *)textColor backgroundColor:(UIColor *)backgroundColor touchBlock:(TouchSwipeButtonBlock)block;
  22. /**
  23. * 创建左滑或右滑时的button, button只有Image没有title
  24. */
  25. + (SwipeButton *)createSwipeButtonWithImage:(UIImage *)image backgroundColor:(UIColor *)color touchBlock:(TouchSwipeButtonBlock)block;
  26. /**
  27. * 创建左滑或右滑时的button,文字图片同时存在,且image在上 title在下
  28. */
  29. + (SwipeButton *)createSwipeButtonWithTitle:(NSString *)title backgroundColor:(UIColor *)backgroundColor image:(UIImage *)image touchBlock:(TouchSwipeButtonBlock)block;
  30. + (SwipeButton *)createSwipeButtonWithTitle:(NSString *)title font:(CGFloat)font textColor:(UIColor *)textColor backgroundColor:(UIColor *)backgroundColor image:(UIImage *)image touchBlock:(TouchSwipeButtonBlock)block;
  31. @end