1

For objective-c, using Xcode 5.1 (all that is available to me), how would you maintain the navigation bar when creating separate storyboards? If the view controllers are all in one storyboard then the navigation bar is easy, but as soon as you put a view controller in a new storyboard it loses all ability to interact with the other navigation controller. Thank you

Edit: When I transfer control I use code such as the following:

 ‑ (IBAction)displayAccountSettings:(id)sender
{
    UIViewController *mainViewController = 
        [[UIStoryboard storyboardWithName:@"AccountSettings" bundle:nil]
          instantiateInitialViewController];

    [self presentViewController:mainViewController
                       animated:YES
                     completion:nil];
}

I have also tried to add this:

 [self.navigationController pushViewController:mainViewController animated:YES];

and that seemed to do nothing. Basically I'm trying to have a homescreen which has several buttons on it, and each button links to a different storyboard (I would like different storyboards as I'm working on the project with several people). We need to keep the navigation bar at the top, however. And it disappears with this method.

user120920
  • 89
  • 2
  • 9

1 Answers1

1

Embed the storyboards within childview controller. That way the nav bar will be everywhere. You have to do the embedding in code or copy all storyboards into one big storyboard to do create that in IB.

Helge Becker
  • 3,219
  • 1
  • 20
  • 33