How to use Storyboard reference to connect 2 storyboards? Is it possible to connect storyboard with xib file? I want to use it via Navigation Controller.
Using Storyboard Reference
1.6k views Asked by Altimir Antonov AtThere are 3 answers
You can load another storyboard simply like this your main storyboard..just replace the name of storyboard and viewcontroller
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"NewStoryboard" bundle: nil];
SomeViewController *someViewController = [storyboard instantiateViewControllerWithIdentifier:@"SomeViewController"];
[self presentViewController:someViewController animated:YES completion:nil];
or Swift
let storyboard = UIStoryboard(name: "NewStoryboard", bundle: nil)
let someViewController = storyboard.instantiateViewControllerWithIdentifier("SomeViewController") as! UIViewController
self.presentViewController(someViewController, animated: true, completion: nil)
Hi Friend this is really easy,
Just create a new Storyboard with file>newfile and get the new Storyboard from User Interface don't forget to name it properly ;)
Drag a Storyboard reference to your main story board and now connect it with button or navigation bar button or tab bar whatever (as per your requirement)and thats it...
Select Storyboard reference and go to Attribute Inspector you can see the dropdown of story board from that select your new Storyboard.
Create any new view controller in the empty Storyboard and make it initial view controller.
Run the code
This is how you do it my friend hope it helps :) Tell me if you are not able to solve will update my answers with screen shots.
if you want to reference two storyboards in Xcode 7, in your initial storyboard select the view controllers you want to use in the second storyboard, in the task bar select "Editor" and then "Refactor to Storyboard", then you have to name the new storyboard and thats all, i don´t know if you can reference to an .xib file, notice that you can use the storyboard reference to call a view even in the same storyboard or even a view that is not connected to any other view, and in the reference you can specify which view you want to load (you do this in the identity inspector), or leave that space empty and the view loaded will be the initial view.
Better explained step by step:
If you want to create the new storyboard at the same time
If you have already created the storyboard
thats how you use storyboard references in Xcode 7, hope that is useful to you