5
votes

I have a storyboard View Controller, which is the first screen in my app. The rest of the app is designed with xib's. I want to segue from a button in the storyboard's VC to a XIB file. I know how to do this from a xib to storyboard, but how about this ?

Thanks in advance !

1

1 Answers

15
votes

From xib to storyboard

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
UIViewController *initViewController = [storyBoard instantiateInitialViewController];

then

[self.window setRootViewController:initViewController];

or

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

From storyboard to xib

YourViewController *viewController=[[YourViewController alloc]initWithNibName:@"ViewControllerName" bundle:nil];

[self presentViewController:viewController animated:YES completion:nil];

In case of NavigatinController

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