| | |
| | | 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, *)) { |