Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transitioning between multiple storyboards in XCode 4

I have not yet seen this question answered:

What is the best way to implement multiple storyboards in XCode 4? An example of when you would want to do this might be in a team environment where multiple people are working on subsections of the same UI.

Any ideas? I might guess it has to be done manually in code but it would be neat if there were a way to do it graphically within the Storyboard editing view.

like image 639
Delete Avatar asked Nov 14 '11 19:11

Delete


2 Answers

Here is a link to an example of using multiple storyboards and how to programmatically link multiple Storyboards: http://www.skillmasters.net/main/?p=193

Here is the author's pertinent sample code:

UIStoryboard *settingsStoryboard = [UIStoryboard storyboardWithName:@"SettingsStoryboard" bundle:nil];
UIViewController *initialSettingsVC = [settingsStoryboard instantiateInitialViewController];
initialSettingsVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:initialSettingsVC animated:YES];
like image 142
craig Avatar answered Nov 14 '22 14:11

craig


And if you want to navigate to a specific view controller then simply use UIViewController *testVC = [(storyboard instance) instantiateViewControllerWithIdentifier:@"(Viewcontroller name)"];

like image 1
GSD Avatar answered Nov 14 '22 15:11

GSD