Search code examples
xcodexcode4interface-builder

Interface Builder: Prevent auto adding subview while dragging


I have a scrollview covering the entire screen of the device which is a subview of the main uiview of the interface. I want to add a uibutton on top of the scrollview but everytime I drag a button over the scrollview, IB keeps adding the button as a subview to the scrollview. I don't want it to be a subview of scrollview I have to manually punch in the coordinates of the button to prevent this behavior.


Solution

  • Grab your control and start dragging it. Before you drop it, hold down Command. Drop it. It won't go into the subview.

    This is on Xcode 7.2. Not certain about earlier versions.