Commit d36e88c96b47922133cef8c2c5873181f216ec56
1 parent
b65e553b
no message
Showing
2 changed files
with
12 additions
and
0 deletions
CNLiveServices/Classes/Manager/CNLivePageJumpManager.h
| @@ -12,6 +12,11 @@ | @@ -12,6 +12,11 @@ | ||
| 12 | NS_ASSUME_NONNULL_BEGIN | 12 | NS_ASSUME_NONNULL_BEGIN |
| 13 | 13 | ||
| 14 | @interface CNLivePageJumpManager : NSObject | 14 | @interface CNLivePageJumpManager : NSObject |
| 15 | +// 获取跟控制器 | ||
| 16 | ++ (UIViewController *)getRootController; | ||
| 17 | + | ||
| 18 | +// 获取导航控制器 | ||
| 19 | ++ (UINavigationController *)getNavigationController; | ||
| 15 | 20 | ||
| 16 | // jump | 21 | // jump |
| 17 | + (void)jumpViewController:(UIViewController *)controller; | 22 | + (void)jumpViewController:(UIViewController *)controller; |
CNLiveServices/Classes/Manager/CNLivePageJumpManager.m
| @@ -11,8 +11,15 @@ | @@ -11,8 +11,15 @@ | ||
| 11 | @interface CNLivePageJumpManager () | 11 | @interface CNLivePageJumpManager () |
| 12 | 12 | ||
| 13 | @end | 13 | @end |
| 14 | + | ||
| 14 | @implementation CNLivePageJumpManager | 15 | @implementation CNLivePageJumpManager |
| 15 | #pragma mark - 获取跟控制器 | 16 | #pragma mark - 获取跟控制器 |
| 17 | ++ (UIViewController *)getRootController{ | ||
| 18 | + UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; | ||
| 19 | + return vc; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +#pragma mark - 获取导航控制器 | ||
| 16 | + (UINavigationController *)getNavigationController{ | 23 | + (UINavigationController *)getNavigationController{ |
| 17 | UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; | 24 | UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; |
| 18 | if ([vc isKindOfClass:[UINavigationController class]]){ | 25 | if ([vc isKindOfClass:[UINavigationController class]]){ |