From cb9232b3ab413fae7bcc2b94abd70f18ca02b263 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 03 十二月 2024 11:20:32 +0800
Subject: [PATCH] 增加铃声;增加TCP/UDP连接选择

---
 HDLLinPhoneSDK(OC)/HDLLinPhoneSDK/HDLLinPhoneCommon.m |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinPhoneCommon.m" "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinPhoneCommon.m"
index d643489..87139e4 100644
--- "a/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinPhoneCommon.m"
+++ "b/HDLLinPhoneSDK\357\274\210OC\357\274\211/HDLLinPhoneSDK/HDLLinPhoneCommon.m"
@@ -22,6 +22,37 @@
     return topController;
 }
 
++(UIViewController *) rootController {
+    UIViewController*topController ;
+    if ([UIApplication sharedApplication].delegate.window) {
+        topController= [UIApplication sharedApplication].delegate.window.rootViewController;
+    }else{
+        topController=[self appWindow].rootViewController;
+    }
+//    while(topController.presentedViewController){
+//        topController=topController.presentedViewController;
+//    }
+    return topController;
+}
+
++(BOOL)rootPresentVCContent:(Class)vcClass{
+    UIViewController*roootVC ;
+    if ([UIApplication sharedApplication].delegate.window) {
+        roootVC= [UIApplication sharedApplication].delegate.window.rootViewController;
+    }else{
+        roootVC=[self appWindow].rootViewController;
+    }
+    while(roootVC.presentedViewController){
+        if ([roootVC.presentedViewController isKindOfClass:vcClass]) {
+            return YES;
+            break;
+        }
+        roootVC=roootVC.presentedViewController;
+    }
+    
+    return NO;
+}
+
 +(UIWindow*)appWindow{
     UIWindow *window;
     if (@available(iOS 13.0, *)) {

--
Gitblit v1.8.0