Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segue from Storyboard to XIB

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 !

like image 792
Sebyddd Avatar asked Aug 23 '13 11:08

Sebyddd


1 Answers

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];
like image 191
2 revs, 2 users 85% Avatar answered Oct 19 '22 12:10

2 revs, 2 users 85%