UITabBarController *classNameVC =(UITabBarController *) [self getCurrentVC];
NSLog(@"++++++++%@",classNameVC);
UINavigationController *selectVC =classNameVC.selectedViewController;
if ([selectVC.topViewController isKindOfClass:[LMSNewPKWebVC class]]) {
}
else
{
[self.window.rootViewController dismissViewControllerAnimated:NO completion:nil];
self.tabbarController.delegate= self;
[self.tabbarController setSelectedIndex:1];
UINavigationController *appNavC = self.tabbarController.viewControllers[1];
LMSNewPKWebVC *vc = [[LMSNewPKWebVC alloc] init];
vc.typeStr = @"4";
vc.urlStr = H5ActivityThroughMap;;
[appNavC pushViewController:vc animated:YES];
}
- (UIViewController *)getCurrentVC
{
UIViewController *result = nil;
UIWindow * window = [[UIApplication sharedApplication] keyWindow];
if (window.windowLevel != UIWindowLevelNormal)
{
NSArray *windows = [[UIApplication sharedApplication] windows];
for(UIWindow * tmpWin in windows)
{
if (tmpWin.windowLevel == UIWindowLevelNormal)
{
window = tmpWin;
break;
}
}
}
UIView *frontView = [[window subviews] objectAtIndex:0];
id nextResponder = [frontView nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]])
result = nextResponder;
else
result = window.rootViewController;
return result;
}