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

What I'd like to do is drag a component/view from one superview to another in Xcode's interface-builder without having its frame/position be reset.

Xcode's default behavior when doing this appears to be to center the view being moved vertically and horizontally in its new superview, while preserving its dimensions. This is extremely frustrating, as it means that the view needs to be manually repositioned in its new superview. But I had it positioned correctly before I moved it, so I'd like Xcode to just remember all attributes of its frame instead of just its width/height. Is this possible?


Solution 1:

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.

Solution 2:

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!