AppDelegate文件中跳转页面

目前知道有两种方式,自己小结一下:

方式一:

    UINavigationController *presentNav = [[UINavigationController alloc] initWithRootViewController:vcReply];
    [self.window.rootViewController presentViewController:presentNav animated:YES completion:^{
        
    }];

方式二:

    if ([self.window.rootViewController isKindOfClass:[UINavigationController class]]) {
        UINavigationController *nacvAD = (UINavigationController *)self.window.rootViewController;
        [nacvAD pushViewController:vcReply animated:YES];
    }

猜你喜欢

转载自wenxin2009.iteye.com/blog/2231863
今日推荐