IOS 从AppDelegate跳转到页面的方法

2017-05-04  本文已影响26人  JakieZhang

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];

上一篇下一篇

猜你喜欢

热点阅读