UIViewController+YOUPAIAlert.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // UIViewController+YOUPAIAlert.m
  3. // MSYOUPAI
  4. //
  5. // Created by admin on 2022/3/16.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "UIViewController+YOUPAIAlert.h"
  9. #import "LZAlertWindow.h"
  10. #import "UIViewController+TFPresent.h"
  11. @implementation UIViewController (YOUPAIAlert)
  12. /**
  13. 确认操作提示框
  14. */
  15. - (void)youpaifAlertWithTitle:(NSString *)title content:(NSString *)content cancelBtn:(NSString *)cancel confimBtn:(NSString *)confim confimBlock:(void (^)(void))block{
  16. LZAlertAction *cancelAction = [LZAlertAction actionWithTitle:cancel handler:^(LZAlertAction *action) {
  17. }];
  18. cancelAction.cornerRadius = 24.0f;
  19. cancelAction.bgColor = LZF5F4F7Color;
  20. cancelAction.color = LZ273145Color;
  21. LZAlertAction *confimAction = [LZAlertAction actionWithTitle:confim handler:^(LZAlertAction *action) {
  22. if (block != nil) {
  23. block();
  24. }
  25. }];
  26. confimAction.cornerRadius = 24.0f;
  27. confimAction.bgColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake((KScreenWidth - 105.0f) / 2.0f, 48.0f) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:GradientLeftToRight]];
  28. confimAction.color = [UIColor whiteColor];
  29. LZAlertWindow *alert = [LZAlertWindow alertWithTitle:title content:content action:@[cancelAction,confimAction]];
  30. alert.contentTextAlignment = NSTextAlignmentCenter;
  31. [self TFPresentVC:alert completion:^{}];
  32. }
  33. @end