首页 > 技术文章 > ios开发之--跳转到指定的TabBarViewController中的某一个VIewController

hero11223 2018-04-04 18:35 原文

比较简单,也很实用,方法大同小异,仅做记录,方法的系统记录如下:

[self dismissViewControllerAnimated:YES completion:^{

        // 这是从一个模态出来的页面跳到tabbar的某一个页面

        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

        UITabBarController *tabViewController = (UITabBarController *) appDelegate.window.rootViewController;

        [tabViewController setSelectedIndex:2];

    }];

需要跳转的时候,跳即可

推荐阅读