IOS 从AppDelegate跳转到页面的方法

1.模态跳转

MessageViewController *VC = [[MessageViewController alloc] init];

UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:VC];

[self.window.rootViewController presentViewController:nav animated:YES completion:nil];


2. PUSH跳转

UITabBarController *tab = (UITabBarController *)_window.rootViewController;

UINavigationController *nav = tab.viewControllers[tab.selectedIndex];

MessageViewController *vc = [[MessageViewController alloc] init];

vc.hidesBottomBarWhenPushed = YES;

[nav pushViewController:vc animated:YES];

你可能感兴趣的:(IOS 从AppDelegate跳转到页面的方法)