From 4c1abca185a5727da6fb314a0cb4cd44bfe1b3bf Mon Sep 17 00:00:00 2001
From: Davin <591807572@qq.com>
Date: 星期五, 07 六月 2024 17:48:47 +0800
Subject: [PATCH] feature appkey修改

---
 EZSDK/EZSDK/EZ/Base/HDLEZAlertInputView.m |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/EZSDK/EZSDK/EZ/Base/HDLEZAlertInputView.m b/EZSDK/EZSDK/EZ/Base/HDLEZAlertInputView.m
index bc19036..3d9ed92 100644
--- a/EZSDK/EZSDK/EZ/Base/HDLEZAlertInputView.m
+++ b/EZSDK/EZSDK/EZ/Base/HDLEZAlertInputView.m
@@ -30,8 +30,8 @@
  @param sureTitle 纭鎸夐挳鏍囬
  */
 +(void)showInputAlertWithtitle:(NSString*)title cancleTitle:(NSString*)cancleTitle sureTitle:(NSString*)sureTitle  keyboardType:(UIKeyboardType)keyboardType cancleBlock:(HDLEZAlertInputViewCancleBlock)cancle sureBlock:(HDLEZAlertInputViewSureBlock)sure{
-    [[[[UIApplication sharedApplication] windows] lastObject] makeKeyWindow];
-    [self showInputAlertToView:[[[UIApplication sharedApplication] windows] lastObject] title:title cancleTitle:cancleTitle sureTitle:sureTitle keyboardType:keyboardType cancleBlock:cancle sureBlock:sure];
+    [[self currentWindow] makeKeyWindow];
+    [self showInputAlertToView:[self currentWindow] title:title cancleTitle:cancleTitle sureTitle:sureTitle keyboardType:keyboardType cancleBlock:cancle sureBlock:sure];
 }
 
 /*灞曠ず杈撳叆寮圭獥
@@ -204,4 +204,20 @@
     }
     return window;
 }
+
+/*鑾峰彇褰撳墠window
+ */
++(UIWindow*)currentWindow{
+    UIWindow *window;
+    if (@available(iOS 13.0, *)) {
+        if ([UIApplication sharedApplication].delegate.window) {
+            window=[UIApplication sharedApplication].delegate.window;
+        }else{
+            window = [UIApplication sharedApplication].windows[0];
+        }
+    } else {
+        window = [UIApplication sharedApplication].delegate.window;
+    }
+    return window;
+}
 @end

--
Gitblit v1.8.0