简体   繁体   中英

Navigate from UIViewController to UITabbarController

I have UIViewController as a rootViewController and I want to navigate from UIViewController to UITabBarController after click button1.

单击button1后导航到tab1。忽略其他按钮

navigate to tab1 after click on button1. ignore other button

here is my IBAction method for btn1

- (IBAction)btn1Click:(id)sender {


 }

Appreciate for help

First You need to give storyboardID to UITabBarController using storyboard, such as tabVC . After that write below code to open the UITabBarController as model segue.

-(IBAction)btn1Click:(id)sender {
     UITabbarController *tabVC = [self.storyboard instantiateViewControllerWithIdentifier:@"tabVC"];
     [self presentViewController:tabVC animated:YES completion:nil];
}

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