AppDelegate里跳转其它界面

2018-08-23  本文已影响214人  姚姚先生

1.模态弹出

DJZMRZResultViewController *VC = [[DJZMRZResultViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:VC];
[self.window.rootViewController presentViewController:nav animated:YES completion:nil];

2.push跳转

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self startLocationServe];
    // 创建窗口
    self.window = [[UIWindow alloc] init];
    self.window.frame = [UIScreen mainScreen].bounds;
    // 显示窗口
    self.window.rootViewController = [DJtestViewController new];
    [self.window makeKeyAndVisible];
}
        UITabBarController *tab = (UITabBarController *)_window.rootViewController;
        UINavigationController *nav = tab.viewControllers[tab.selectedIndex];
        DJZMRZResultViewController *vc = [DJZMRZResultViewController new];
        vc.hidesBottomBarWhenPushed = YES;
        [nav pushViewController:vc animated:YES];

搞定

上一篇下一篇

猜你喜欢

热点阅读