美文网首页iOS技术集
iOS 从AppDelegate中跳转指定页面

iOS 从AppDelegate中跳转指定页面

作者: Swift社区 | 来源:发表于2017-08-16 09:43 被阅读53次

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技术交流群:668562416

相关文章

网友评论

    本文标题:iOS 从AppDelegate中跳转指定页面

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