0

Me and other people work in the same project, but separately. Imagine that the first person creates a Storyboard project with a UITableViewController. The second one wants to include the previous element in his own Storyboard project. How can I connect these two Storyboard projects?

Thanks

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
Anthony
  • 2,801
  • 3
  • 30
  • 49
  • You could use a software versioning system (also called svn). Otherwise you have to merge by hand. – Lorenzo B Jan 06 '12 at 10:23
  • I don't think version control would help here. Storyboards are in undocumented XML, I wouldn't like to try merging them in SVN… – Amy Worrall Jan 06 '12 at 16:20

1 Answers1

1

I have one solution: simply create a property or variable as appropriate. For example:

    @property (strong, nonatomic) UIStoryboard * storyboard1;
    @property (strong, nonatomic) UIStoryboard * storyboard2;

    .....

    .m
    -(void)initMyStoryboards{
       storyboard1 = [UIStoryboard storyboardWithName:@"storyboard1" bundle:nil];
       storyboard2 = [UIStoryboard storyboardWithName:@"storyboard2" bundle:nil];
    }

    -(void)launchViewFromS1{
         //use view in storyboard1
         MyViewController1 *myViewController = [self.storyboard1 instantiateViewControllerWithIdentifier:@"MainView"];
         ....
    }

    -(void)launchViewFromS2{
        //use view in storyboard2
        MyViewController2 *myViewController2 = [self.storyboard2 instantiateViewControllerWithIdentifier:@"OtherView"];
        ....
    }

other exemple:

-(void)launchMyView{
    UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"storyboard1" bundle:nil];
    ViewController1 *myViewController =[storyboard instantiateViewControllerWithIdentifier:@"MainView"];
    ....
}
Anthony
  • 2,801
  • 3
  • 30
  • 49