LCActionSheet.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // Created by 刘超 on 15/4/26.
  3. // Copyright (c) 2015年 Leo. All rights reserved.
  4. //
  5. // Email: leoios@sina.com
  6. // GitHub: http://github.com/LeoiOS
  7. // 如有问题或建议请给我发Email, 或在该项目的GitHub主页lssues我, 谢谢:)
  8. //
  9. #import <UIKit/UIKit.h>
  10. @class LCActionSheet;
  11. @protocol LCActionSheetDelegate <NSObject>
  12. @optional
  13. /**
  14. * 点击了buttonIndex处的按钮
  15. */
  16. - (void)actionSheet:(LCActionSheet *)actionSheet didClickedButton:(UIButton *)button;
  17. /**
  18. * 点击了空白处
  19. */
  20. - (void)actionSheet:(LCActionSheet *)actionSheet didClickedBlankPlace:(NSInteger)buttonIndex;
  21. @end
  22. @interface LCActionSheet : UIView
  23. @property (copy,nonatomic) NSString *title;
  24. /**
  25. * 返回一个ActionSheet对象, 类方法
  26. *
  27. * @param title 提示标题
  28. *
  29. * @param titles 所有按钮的标题
  30. *
  31. * @param buttonIndex 红色按钮的index
  32. *
  33. * @param delegate 代理
  34. *
  35. * Tip: 如果没有红色按钮, redButtonIndex给`-1`即可
  36. */
  37. + (instancetype)sheetWithTitle:(NSString *)title
  38. buttonTitles:(NSArray *)titles
  39. redButtonIndex:(NSInteger)buttonIndex
  40. delegate:(id<LCActionSheetDelegate>)delegate;
  41. /**
  42. * 返回一个ActionSheet对象, 实例方法
  43. *
  44. * @param title 提示标题
  45. *
  46. * @param titles 所有按钮的标题
  47. *
  48. * @param buttonIndex 红色按钮的index
  49. *
  50. * @param delegate 代理
  51. *
  52. * Tip: 如果没有红色按钮, redButtonIndex给`-1`即可
  53. */
  54. - (instancetype)initWithTitle:(NSString *)title
  55. buttonTitles:(NSArray *)titles
  56. redButtonIndex:(NSInteger)buttonIndex
  57. delegate:(id<LCActionSheetDelegate>)delegate;
  58. - (void)show;
  59. @end