美文网首页
IOS 从AppDelegate跳转到页面的方法

IOS 从AppDelegate跳转到页面的方法

作者: JakieZhang | 来源:发表于2017-05-04 17:20 被阅读26次

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跳转到页面的方法

      本文链接:https://www.haomeiwen.com/subject/zqrdtxtx.html