ios-UI

iOS跳转到指定tabBar界面

2017-04-13  本文已影响3832人  zhengelababy

AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;

UIViewController *controller = app.window.rootViewController;

【(SuerTabBarViewController是继承于TabBarViewController的相当于mainViewController)】 SuerTabBarViewController *rvc = (SuerTabBarViewController *)controller;

[rvc setSelectedIndex:3];//假如要跳转到第四个tabBar那里,因为tabBar默认索引是从0开始的

[weakSelf.navigationController popToRootViewControllerAnimated:YES];

上一篇下一篇

猜你喜欢

热点阅读