I have several UIViewControllers
in one Storyboard.
Now I want to move some UIViewControllers
to another Storyboard. Is it possible?

- 6,538
- 6
- 44
- 64

- 3,580
- 4
- 27
- 33
-
You can do it by [copying and pasting the view controller either in the storyboard or the XML code](http://stackoverflow.com/a/38247404/3681880). – Suragch Jul 07 '16 at 14:23
10 Answers
Yes, it is possible.
- Select controllers you want to copy
- Press Command + C
- Open your second storyboard file
- Press Command + V
Note: "IBOutlets remains as is after copying(Verified on Xcode 6.3.2)."

- 4,765
- 2
- 23
- 25
-
1This is excellent. I had been having issues when I manually copied my Storyboard in the Finder, copying it from an Apple sample project to my own project. The issues disappeared when I created the storyboard in the target project, then copied and pasted the contents in. Strange. – Vern Jensen Oct 07 '13 at 21:04
-
1It is working solution @Fady Kamal. Sometimes it is not working from the first time - it depends where the focus is on X-Code. – new2ios Jun 11 '15 at 13:13
-
2Ok, @Rahul, but what happens with outlets - are they properly set, or I have to relink them? – new2ios Jun 11 '15 at 13:14
-
1You can try duplicate too. Command + D or Edit-Duplicate will do the magic ! – Alvin George Sep 29 '15 at 07:21
-
I have tried to copy view controllers between two projects like this in Xcode 6.4 and it worked perfectly. – Akhil Balakrishnan Oct 22 '15 at 06:57
-
If you ask me, this doesn't work in Xamarin. My outlets now don't update automagically when trying to add event handlers to buttons, for example. – Chucky Jul 06 '16 at 14:53
-
You must select the view controller, not the view controller scene. it work perfectly even from one project to another – Nicolas Manzini Aug 09 '16 at 14:55
-
While pasting, you will have to select the view controller area where you usually drop UI elements. – nefarianblack Dec 05 '16 at 10:55
-
1Confirmed still working in Xcode 8.3.2 . IBOutlets, IBActions, storyboard ID's, segues all copied over perfectly. I didn't break any segues though, , meaning I didn't remove a view controller on the end of a segue and put it into another storyboard. I did copy segues, but only where I copied the origin view controller and the destination view controller and moved them to the new storyboard together – MikeG May 24 '17 at 17:45
-
The view controller gets copied exactly on top of the existing view controller. You need to drag it from on top of it. – Tejas K Apr 18 '18 at 08:53
-
Didn't work for me at first. Lots of crashes (Xcode 11). Worked on the 4th or 5th attempt. – Oct 15 '19 at 19:41
-
-
It is possible to copy, but you have to open both storyboards at once in one project, and then copy and paste.

- 907
- 8
- 14
-
10This is actually what resolves my problem. BOTH storyboards have to be open using assistant editor! Thank you! – Chen Li Yong Mar 01 '16 at 06:22
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.

- 1,389
- 9
- 17
-
This is extremely helpful. It preserves all the existing relationships and segues, unlike other methods. – Hobo Joe Mar 15 '17 at 15:40
-
Copy-paste (Command+C, Command+V) works fine but remember to resolve outlet connections because Xcode seems to keep the original connections: close/reopen project, delete what's wrong and reestablish missing connections.

- 2,176
- 1
- 16
- 12
It´s possible to copy/paste but it only works if you have both Storyboards open side by side using Xcode´s Assistant Editor.

- 3,409
- 1
- 29
- 35
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.

- 736
- 1
- 12
- 22
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.

- 33,281
- 23
- 160
- 191
I have came up to a similar situation, where in my Main storyboard I have too many scenes and need to refactor. The idea that I had in the beginning was to mark several and do copy paste as suggested by many. However, I was concerned for any resolution of storyboard connections to the view controllers code. After much searching I found that since iOS 9 there is a new feature available to "Refactor to Storuboard". You may mark several scenes in your source storyboard and you can select from the Editor menu that option. Then all selected scenes are extracted from your old storyboard, a new storyboard is created as well as a link to that in the old/main storyboard. Useful totorials are: https://code.tutsplus.com/tutorials/ios-9-staying-organized-with-storyboard-references--cms-24226 https://www.raywenderlich.com/115697/ios-9-storyboards-tutorial-whats-new-in-storyboards
I hope that this new official storyboard refactoring functionality can provide a better solution to this kind of problems.

- 101
- 1
- 9
Came to a similar situation where I needed to share one ViewController Class with 2 StoryBoard Controllers.
Apparently, the solution was simple enough:
- Split your screen between storyboard and code
- From the Storyboard select the control that is missing the connection with the class
- In the Connection Inspector, Click and Drag on the circle inside the Referencing Outlets to the code inside the Class Controller
- XCode will automatically highlight the @IBOutlet that is about to create a connection for
- as soon as you release your mouse, a connection is created between that control on the IB and in the Class
Hope this is clear enough and helpful

- 104
- 2
- 5
I think it is possible....
UIStoryboard *secondStoryBoard = [UIStoryboard storyboardWithName:@"secondStoryBoard" bundle:nil];
UIViewController *theTabBar = [secondStoryBoard instantiateViewControllerWithIdentifier:@"myTabBar"];
[self.navigationController pushViewController:theTabBar animated:YES];
-
i mean to move viewcontroller scene between storyboards in xcode – Vladimir Berezkin Nov 16 '12 at 13:23
-
Question was to move/copying VC in Storyboard. I dont think so your answer anywhere solving this problem. – Alok C Apr 06 '16 at 19:13