Using multiple storyboards with a TabBarController

前端 未结 4 1019
时光说笑
时光说笑 2020-12-09 06:34

Okay, so in the process of developing my newest app, I found that my storyboard got huge, so in an effort to clean it up some, i have divided it into mult

4条回答
  •  清歌不尽
    2020-12-09 06:59

    Add Following code to your LinkViewController

    -(void) awakeFromNib{
        [super awakeFromNib];
        ///…your custom code here ..
    
        UIStoryboard * storyboard = [UIStoryboard storyboardWithName:self.storyBoardName bundle:nil];
        UIViewController * scene = nil;
    
        // Creates the linked scene.
        if ([self.sceneIdentifier length] == 0)
            scene = [storyboard instantiateInitialViewController];
        else
            scene = [storyboard instantiateViewControllerWithIdentifier:self.sceneIdentifier];
            if (self.tabBarController)
                scene.tabBarItem = self.tabBarItem;
        }
    

    Here is the screenShot for LinkViewController ScreenShot.

    LinkViewController is just a placeholder where new viewController would be placed. Here is the sample code which I used for my app.

    RBStoryboardLink . Its working great for me. Let me know if it is helpful for you.

提交回复
热议问题