思路很簡單案训,(這里用的是NavgationController)凡傅,在app delegate 取到根控制器,拿到當(dāng)前所展示的VC瓶蚂,用這個VC push 到指定的界面去糖埋。
TrackOrderVC *orderVC = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"TrackOrderVC"];
//拿到根控制器
XNNavgationController *rootVC = (XNNavgationController *)self.window.rootViewController;
//取到當(dāng)前展示的VC
PayMoneyViewController * payVC =(PayMoneyViewController *)rootVC.visibleViewController;
//跳轉(zhuǎn)到訂單頁面
[payVC.navigationController pushViewController:orderVC animated:YES];
DLog(@"rootVC.visibleViewController =%@", rootVC.visibleViewController);
DLog(@"%@",rootVC.viewControllers);