Browse Source

1.修改iOS RAUtils增加Alert使用AlertController实现。

Pen Li 7 năm trước cách đây
mục cha
commit
33e3835929
2 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 2 0
      RedAnt ERP Mobile/common/RAUtils.h
  2. 15 0
      RedAnt ERP Mobile/common/RAUtils.m

+ 2 - 0
RedAnt ERP Mobile/common/RAUtils.h

@@ -79,4 +79,6 @@
 
 + (NSString *)deviceID;
 
++ (void)ra_showAlertTitle:(NSString *)title message:(NSString *)msg withViewController:(UIViewController *)vc;
+
 @end

+ 15 - 0
RedAnt ERP Mobile/common/RAUtils.m

@@ -937,6 +937,21 @@ done:
     return md5Str;
 }
 
++ (void)ra_showAlertTitle:(NSString *)title message:(NSString *)msg withViewController:(UIViewController *)vc {
+    
+    if (vc) {
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        [alertVC addAction:okAction];
+        
+        [vc presentViewController:alertVC animated:YES completion:nil];
+    }
+    
+}
+
 @end