1
votes

I currently see that when I Segue to another StoryBoard ViewController that is part of a the Tabbar menu. it shows up the ViewController But does not show the Menu Tabbar.

enter image description here

Here is my Code

- (IBAction)endCall:(id)sender {

    NSLog(@"End Call");

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"callHistory"];
    [self presentViewController:vc animated:YES completion:nil];

}

Note: The User Recent History View Controller Only Contains a ViewController .m and is linked to a Storyboard Tabbar Controller on Storyboard it does not contain a TabbarController Class

1
you have to embed a navigation controller between them.mostworld77

1 Answers

0
votes

I suggest you use a UITabBarController for the tab bar and segue to the tab bar view controller instead. Then in your tabBarViewController viewdidload() method, you can select which tab you wish to display.

Personally I would declare a BOOL property called "backFromStart" in the tabBarViewController.h like so->

@property (nonatomic, assign) BOOL backFromStart;

Then set this BOOL in the prepareForSegue:() method of startCellViewController like this:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
  if ([[segue identifier] isEqualToString:@"backToTabBarVC"])
    {
       TabBarVC *destinationVC = segue.destinationViewController;
       destinationVC.backFromStart = YES;
       // Pass any other data to the callHistoryVC if required like so->
       callHistoryVC *historyVC = [destinationVC.viewControllers objectAtIndex:0]; // objectAtIndex 0 as this is your first and only tab.

    }
}

And finally select the tab if the BOOL "backFromStart" was set in tabBarController.m viewdidload() method:

if(backFromStart) {
  backFromStart = NO;
  [self setSelectedIndex:0];
}

NOTE: Now since you have just one tab the BOOL is not really required but just in case you decide to add more tabs!