How to select multi controllers in storyboard? - ios

Here is my storyboard:
and I know it looks crazy , so I plan to use storyboard reference to move the right part of the storyboard in to a new storyboard. and I googled ,it says press the shift can multi selected controllers ,but it dose not work.
so how can I move multi controllers at same time?
I have tried to use mouse ,but it only selected 5 controllers in the upper part 。
But I want to select all of them.

Just select them by dragging mouse:
And then press key Command + C to copy them,
then open the second Storyboard, press key Command + V to paste them.

Yes, it is possible.
Select controllers you want to copy
Press Command + C
Open your second storyboard file
Press Command + V

It is very easy no any key is required just select using mouse
i post the gif..

Hold down Option and scroll mouse wheel until minimum resolution, 6.25%
Click and Drag to select all view controllers - or ones you want to copy.
Click Edit->Copy or Use Ctrl+C
Go to Target Storyboard. Click Edit->Paste or Ctrl+V.
I tested this with about 40 controllers,looks like you have around that much. Old question, but new answer! :). In case anyone still looking.
Also I key-bind Option+Z to "Zoom to Fit" and this centers and displays all controllers with the Interface Builder canvas.

Related

Controls Inspector Below Identity Inspector Missing in Xcode 10

I recently updated my Xcode 9 to Xcode 10.1. At the right bottom of the inspector pane for storyboard, the searchbox that always used to be there for finding controls such as ViewController, UIImageView, UITextfield etc. and dragging them to the storyboard is missing. I can't find it anywhere in the menu structure.
Does anyone know how to get it to display?
It goes top right, left to the Show Standard Editor button.
you can access it with shift + cmd + L too.
Don't forget to select a xib or storyboard file first.
And it name is Library by the way.

Copy view controller from one project to another

I am working on project X. I needed to add component Y to the project. So I go and create component Y as a separate project, say Project W. Now I need to copy Project W into Project X as component Y. How do I do that? I don't mind copying one piece at a time such as: copy ViewControllers in storyboard manually, and then copy the classes manually. Thanks for any help.
Go to the ViewController or storyboard object, select the top bar so you're selecting the whole thing, and then hit COMMAND + C to copy.
Then go to your other project, and open up Storyboard, and place your cursor down onto the open field, and hit COMMAND + V to paste it.
Typically you then have to zoom out on storyboard scene to see it, as for some reason it'll place it down all cattywampus. However, you'll see the files appear in your list of scenes (middle or left panel).

Selecting all outlets on xcode ios 8

I was just wondering how I can select all outlets on xcode ios 8. Some of my labels are on top of each other, so I cant select them.
Thanks
Probably the most useful secret trick in Xcode's nib editor is to Shift-Control-click on an interface item in the canvas. This gives a menu where you can select that interface item or anything behind it.
If I understand you correctly, you are trying to select some elements but because they are overlapping you can't get to them.
Click on the box with a line in it as show in the illustration and it will show all your elements and you can select it from their. In previous Xcode versions it was an arrow instead of a line.
Thank you #matt for pointing out, that is called the Document Outline.

Can I copy a storyboard from one project to another project?

To reuse a storyboard, could I simply copy it from one project to another project (then make modification to the storyboard as required)?
Yes you can, just make sure they are selected as your main storyboards as per image below.
As #Muhammad said you can and it is very simple!
You just have to drag the Storyboard file from one project to another and select all options (The same procedure as importing anything else!).
Next, you just need to go to your project options by clicking on the project icon in the left upper side of project navigator.
Then you just need to select this storyboard to be your storyboard and that's it.
Method 1
Select the View Controller in the storyboard and press Command + C to copy. Then press Command + V to paste in the second storyboard. Check the document outline to see where it was pasted to.
Method 2
Right click the storyboard file in the Project Navigator and select Open As > Source Code. Scroll down the XML code until you find your View Controller. It will look something like this:
<!--My View Controller-->
<scene sceneID="tne-QT-ifu">
...
</scene>
Copy this and paste it in the second project's storyboard file.
Notes
You must also copy over the view controller swift file, of course, but the outlets shouldn't need to be reconnected.
It's simple. Just follow these steps:
Press cmd + D while selecting your desired storyboard scene. It will create a duplicate copy of your selected scene.
Press cmd + x to cut the scene from the existing project.
Press cmd + v into the storyboard section of the second project.
Cheers.

How to select background views in a storyboard or xib

If I select a view with my mouse in a storyboard or xib, Xcode will select the front most view. I know that I can select the other views in the document outline, but if I want to grab a background view to move it with my mouse, the front most view gets selected again when I click in the storyboard.
I think there is a way to cycle through the views and select the ones in the back by holding down on some keys, but I can't find what it is. Does anyone know?
I'm using Xcode 4.6. I know that I can also move background views using the size inspector, but I'm looking for a way to position them with my mouse.
One way is to use the jump bar at the top of the editor. It's the control that shows the path of objects leading to the current selection.
Another way is to press control+shift and left click (or shift right click) an item. That shows you all of the objects under the mouse in a menu, and allows you to disambiguate the one you meant to select.
The good news: Place your mouse on the overlapped images, press and hold shift and right click the mouse. You should see the list of objects, select your object in the back. You can resize as you wish.
The bad news: you can only use the cursor arrows if you want to move it!
Select the view from the menu on the left of interface builder.

Resources