美文网首页
iOS多次push,返回指定根模块

iOS多次push,返回指定根模块

作者: WuNai | 来源:发表于2017-09-24 17:04 被阅读10次

    方法一

    self.tabBarController.selectedIndex = 2;
    [self.navigationController popToRootViewControllerAnimated:YES];
    

    方法二

    MyFunTabBarController *myFunVc = [[MyFunTabBarController alloc] init];
    [self presentViewController:myFunVc animated:YES completion:nil];
    self.view.window.rootViewController = myFunVc;
    

    方法三

    AppDelegate *appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    MyFunTabBarController *myFunVc = [[MyFunTabBarController alloc] init];
    myFunVc.selectedIndex = 3;
    appdelegate.window.rootViewController = myFunVc;
    

    相关文章

      网友评论

          本文标题:iOS多次push,返回指定根模块

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