From 2265a8478325a04871aab6a86d49c28d7d65443a Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 29 五月 2023 15:17:01 +0800 Subject: [PATCH] 增加开锁二次确认弹窗 --- 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