Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 224
ninjaneer Avatar asked Dec 06 '11 02:12

ninjaneer


1 Answers

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.

like image 105
Dan Loughney Avatar answered Nov 04 '22 19:11

Dan Loughney