I have several UIViewControllers
in one Storyboard.
Now I want to move some UIViewControllers
to another Storyboard. Is it possible?
It´s possible to copy/paste but it only works if you have both Storyboards open side by side using Xcode´s Assistant Editor.
Interface elements can be moved between Xib and Storyboard files via Copy / Paste.
This was not originally working for me. I was attempting to copy a UICollectionViewCell from a dedicated Xib to our Main Storyboard. The cell would not copy into the Storyboard.
The solution was to Select the specific parent element in the storyboard. The UICollectionViewCell can be pasted in as a child of a UICollectionView in the storyboard, but otherwise cannot be pasted.
If you're having trouble pasting a specific item, be sure to double check that you have selected a valid parent element before attempting to paste.
In Xcode 8, if specifically you want to move view controllers to another storyboard, just select the view controller(s) which you want to move by Cmd + click the view controller. Keeping them selected, Go to the Editor tab and Choose Refactor to Storyboard. It will ask you the name of the new storyboard file and press Enter.
A new storyboard file will be created with your selected view controllers in it. In the Main.storyboard, you will see a Storyboard Reference object in place of that view controller, which is your reference to the new storyboard you just made.
I think it is possible....
UIStoryboard *secondStoryBoard = [UIStoryboard storyboardWithName:@"secondStoryBoard" bundle:nil];
UIViewController *theTabBar = [secondStoryBoard instantiateViewControllerWithIdentifier:@"myTabBar"];
[self.navigationController pushViewController:theTabBar animated:YES];
Yes, it is possible.
Note: "IBOutlets remains as is after copying(Verified on Xcode 6.3.2)."
If using Cut-n-Paste fails for you, there is a workaround. Paste will fail if there is now ViewController in the file that is being pasted in. That makes it impossible to select the storyboard for pasting. XCode will refuse to paste. So you need to first drag in an empty view controller into the storyboard from the library. Then select this viewController in the storyboard and then the paste will work. After you are done pasting you can delete the dummy viewController. You won't need it again.