Using Xcode 12 interface builder, I am unable to drag a view into a scrollview. This seems to be a very simple task that was working fine for a few years. I'm not sure what I am missing. Dragging views into other views is working perfectly though.
Asked
Active
Viewed 2,354 times
3 Answers
29
I have the same issue on Xcode 12.0.1. As a workaround you can start by setting up the root view of your scroll view content, select it and use the Editor / Embed in / Scroll View
command (or alternatively, the last bottom right icon in the canvas). Then you can add to the root content view normally by drag & dropping.

amadour
- 1,600
- 11
- 20
-
6Unbelievable... So much regressions in this Xcode, such a shame. If Apple applied the same policy to their own softwares than they apply to our apps, then Xcode won't have done its way to the AppStore – Didier Nizard Jan 29 '21 at 18:44
17
I've wasted more time than I'd like to admit on this one. You should drag directly into the drawing canvas, not into the view hierarchy inspector.

Itamar Manor
- 257
- 4
- 11
-
What is wrong with Xcode? Rofl is that a bug? Thanks for the help though – ralphgabb Jun 02 '21 at 08:28
-
<- at least i have them all with just a shortcut whenever XCode does these to me – kolboc Jun 15 '21 at 15:27
2
While embedding is not available i use this trick:
- Remove Safe area Layout guide and Safe area Relative margins from parent view
- Add your desired subview
- Return back all safe area settings

Mikhail Vasilev
- 720
- 6
- 13