Xcode - Is there a way to drag a component from one view to another without losing its frame? Xcode - Is there a way to drag a component from one view to another without losing its frame? xcode xcode

Xcode - Is there a way to drag a component from one view to another without losing its frame?


Another solution:

  1. Select the items you want in your subview, then
  2. (in the tool bar) Editor > Embed In > view type to embed in.


I found something that might help you guys!

The task is to regroup "child views" into "parent view" so they become children of parent view hierarchically and retain physical positions on display as before action.

First, adjust the parent view to physically covers area of child views. Second, make sure that all children are bellow it in the view list.

Now select all children with the mouse and move them e.g. one pixel up and one pixel down (just to say IB there is some change). After that release children and they will magically become children of the parent and keep their positions on display.

It works for me on OSX 10.8.2 and Xcode 4.6.

Good luck!


I managed to save a lot of time spent repositioning stuff and did this:

  1. Add the parent view in Interface Builder on the same level as the would-be subviews.
  2. Open the storyboard in a text editor and copy the would-be subviews inside the subviews tags of the parent view. XCode is going to update once you save it.

Not very elegant though, can't see why XCode doesn't support it with Shift or something.