Applying Auto-Layout to a UIScrollView in Interface Builder

I always forget how to properly add a UIScrollView to the root view of a view controller in Interface Builder. Since, I have a poor memory, this article is a note for myself and other people who want to remind themselves how to do it.

Steps

Note: The names of objects in italics are the same ones as those used in the picture below for easy reference.

Here’s how the document outline should look like in your IB:

Interface Builder’s Document Outline
Interface Builder’s Document Outline

Software developer, traveler, history-philosophy-science enthusiast.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store