Adding the Scroll View

The starter project for this chapter has an updated edit view, as shown in the highlighted portions of Figure 6-5. Your first thought might be to simply embed the form view inside a scroll in the same way you added bounce scrolling to the add car scene. In this case, embedding is not what you want to do, and the reason is auto layout.


Figure 6-5 New edit view form and hierarchy

When the content view is the same size as the scroll view, it is possible to create a complete set of constraints for that content view in relation to its scroll view. This does not work when the size of the content inside the scroll view can be ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.