简体   繁体   中英

How to show tabBar then segue to other viewController and return to this?

I have some viewControllers, I show the first viecontroller in tabBarController. Then I show other viewCOntroller from a button. The next viewController haven't tabBar, but if I want return to the first viewController in TabBar this not whow the tabBar.

Can't I use this code:

 myviewController *viewController = [[UIStoryboard storyboardWithName:@"Vista1" bundle:nil] instantiateViewControllerWithIdentifier:@"vist2"];
[self.navigationController pushViewController:viewController animated:NO];

How can I declare a instantiation of tabBar index 1 view? How can I solve this and show the firstView how first time was showed?

Thanks!

You can use this to return to the number one viewController for example.

[self.tabBarController setSelectedIndex:0];

you can specify the desired index of the tabBar controller

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM