问题
I have 90% of my current project done in storyboard but I am also using a single xib view controller for an "enter your pin" view because this is the way it was integrated in a github project that I imported into my project. I need to segue from the xib back to storyboard. Going from storyboard to the xib was easy with a push method but now I would like to modal to another view in storyboard. Any suggestions? First, I tried to convert the xib to a view in storyboard but I failed as it was designed to work with nibs.
回答1:
You can create a new instance of any view controller on the storyboard by calling its instantiate method.
So do something like:
[storyboard instantiateViewControllerWithIdentifier:@"identifier"];
回答2:
First get the ViewController you need from your storyboard (therefor you need to set an identifier for the viewcontroller in the storyboard
ViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"identifier"];
Then segue to this controller
[self presentModalViewController:vc animated:YES];
来源:https://stackoverflow.com/questions/12076393/how-to-perform-segue-to-a-nib-from-storyboard