RKActionSheet.h 993 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // RKActionSheet.h
  3. // YBVideo
  4. //
  5. // Created by YB007 on 2020/7/2.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSInteger,RKSheetType) {
  10. RKSheet_Default, //功能按钮
  11. RKSheet_Cancle, //取消按钮
  12. RKSheet_FunPink, //功能键-红色
  13. };
  14. typedef void (^RKSheetBlock)(void);
  15. @interface RKActionSheet : UIView
  16. - (instancetype)initWithTitle:(NSString *)titleStr;
  17. -(void)addActionWithType:(RKSheetType)sheetType andTitle:(NSString *)titile complete:(RKSheetBlock)complete;
  18. -(void)showSheet;
  19. -(void)showLandscapeSheet:(UIView*)view;
  20. //调用示例 注意 type 区分
  21. /**
  22. YBWeakSelf;
  23. RKActionSheet *sheet = [[RKActionSheet alloc]initWithTitle:@""];
  24. [sheet addActionWithType:RKSheet_Default andTitle:@"" complete:^{
  25. //...
  26. }];
  27. [sheet addActionWithType:RKSheet_Default andTitle:@"" complete:^{
  28. //...
  29. }];
  30. [sheet addActionWithType:RKSheet_Cancle andTitle:@"" complete:^{
  31. }];
  32. [sheet showSheet];
  33. */
  34. @end