GlobalAlertV.m 763 B

1234567891011121314151617181920212223
  1. //
  2. // GlobalAlertV.m
  3. // AIIM
  4. //
  5. // Created by gan on 2025/6/25.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "GlobalAlertV.h"
  9. @implementation GlobalAlertV
  10. + (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
  11. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
  12. UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
  13. [alertController addAction:okAction];
  14. UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
  15. [rootViewController presentViewController:alertController animated:YES completion:nil];
  16. }
  17. @end