CustomActionSheet.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // CustomActionSheet.h
  3. // MIT_Shop
  4. //
  5. // Created by 翟玉磊 on 2017/10/17.
  6. // Copyright © 2017年 翟玉磊. All rights reserved.
  7. //
  8. //列表式sheet
  9. #import <UIKit/UIKit.h>
  10. @interface CustomActionSheet : UIView
  11. /**
  12. 快速创建
  13. @param title 标题
  14. @param cancel 取消按钮
  15. @param titles 其他按钮
  16. @return 返回实例
  17. */
  18. + (instancetype)showActionSheetWithTitle:(NSString *)title cancelTitle:(NSString *)cancel otherButtonTitles:(NSArray *)titles;
  19. /**
  20. 整个sheet的标题
  21. */
  22. @property (nonatomic, copy) NSString *title;
  23. /**
  24. 取消按钮标题
  25. */
  26. @property (nonatomic, copy) NSString *cancelTitle;
  27. /**
  28. 其他按钮标题数组 是可变数组
  29. */
  30. @property (nonatomic, strong) NSMutableArray *otherButtonTitleArray;
  31. /**
  32. 其他按钮的高度 默认OtherButtonHeight
  33. */
  34. @property (nonatomic, assign) CGFloat otherButtonHeight;
  35. /**
  36. 选中标示替换
  37. */
  38. @property (nonatomic, strong) UIImage *markImage;
  39. /**
  40. 显示
  41. */
  42. - (void)show;
  43. /**
  44. 隐藏
  45. */
  46. - (void)dismiss;
  47. /**
  48. 选中按钮回调(包含取消/确认按钮:索引是otherButtonTitleArray.count)
  49. buttonIndex 按钮索引
  50. selectedIndex 选中条件项的索引
  51. */
  52. @property (nonatomic, copy) void(^actionSheetDidSelectedAtIndex)(NSInteger buttonIndex, NSInteger selectedIndex);
  53. @end