搜索
您的当前位置:首页正文

AppDelegate跳转到指定的VC

来源:二三娱乐

思路很简单,(这里用的是NavgationController),在app delegate 取到根控制器,拿到当前所展示的VC,用这个VC push 到指定的界面去。

TrackOrderVC *orderVC = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"TrackOrderVC"];
//拿到根控制器
XNNavgationController *rootVC = (XNNavgationController *)self.window.rootViewController;
//取到当前展示的VC
PayMoneyViewController * payVC =(PayMoneyViewController *)rootVC.visibleViewController;
//跳转到订单页面
[payVC.navigationController pushViewController:orderVC animated:YES];

DLog(@"rootVC.visibleViewController =%@", rootVC.visibleViewController);
DLog(@"%@",rootVC.viewControllers);
Top