Xcode - dragging control from library to preview doesn't work

Sorry about my English, I'm using a translator.

I'm taking a programming course with Swift in Xcode and one of the steps is to drag a control from the library into the view to place it below another control (both are "text").

In the preview, there is a text in the center of the mobile screen.

In the video, open the library window with Shift + Command + L; then drag a "text" control to the preview that simulates a mobile phone and a stripe appears below the text control that I mentioned before, which means that that text will be placed below it. If you put it on top, then the line appears on top and the same if you put it on the sides.

I have the option that appears below the phone, the one that says "Selectable", activated, so that I can select what I want in that phone simulation.

The fact is that when I drag the text control from the library and try to put it below or in another position with respect to the text that already exists, it does nothing. The stripes do not appear, nor do you set the control.

What could it be due to? I am using Xcode 15.3

Thank you.

Replies

Hi,

Sorry to hear you are having problems. In this case you are doing everything correct; the problem is the tutorial is a bit out of date and the ability to drag items from the library to the preview was removed in Xcode 15.

You can drag from the library to the source editor which will then have those items show up in the preview.

Hope that helps!

Thanks for your reply.