Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you stop Interface Builder embedding a control in a UIView when I drag it around?

When I move controls in Interface Builder and pass over a UIView. Is there anyway to stop IB from embedding the control in the UIView and making it a child of the UIView in the tree hierarchy.

BEFORE
+UIView
+UIButton
+UIView

If I move the UIButton with the mouse and place it above the UIView IB will make it a child of the UIView

AFTER
+UIView
  +UIButton
+UIView

Is there anyway to lock the bottom view. I often use them as backgrounds and tint them.

like image 999
brian.clear Avatar asked Jan 09 '13 10:01

brian.clear


1 Answers

You can reposition without embedding by pressing and holding Cmd while dragging the element.

Edit: This is only confirmed to work with Xcode 7.

like image 157
Henrik Avatar answered Nov 05 '22 05:11

Henrik