Using UIScrollView

When you want to let the user scroll around your view, you typically make your view the subview of a UIScrollView, as shown in Figure 6.4.

Figure 6.4  Object diagram

Object diagram

In HypnosisterAppDelegate.m, put your view inside a scroll view and add that scroll view to the window:

-​ ​(​B​O​O​L​)​a​p​p​l​i​c​a​t​i​o​n​:​(​U​I​A​p​p​l​i​c​a​t​i​o​n​ ​*​)​a​p​p​l​i​c​a​t​i​o​n​
 ​ ​ ​ ​d​i​d​F​i​n​i​s​h​L​a​u​n​c​h​i​n​g​W​i​t​h​O​p​t​i​o​n​s​:​(​N​S​D​i​c​t​i​o​n​a​r​y​ ​*​)​l​a​u​n​c​h​O​p​t​i​o​n​s​
{​
 ​ ​ ​ ​C​G​R​e​c​t​ ​w​h​o​l​e​W​i​n​d​o​w​ ​=​ ​[​[​s​e​l​f​ ​w​i​n​d​o​w​]​ ​b​o​u​n​d​s​]​;​

 ​ ​ ​ ​U​I​S​c​r​o​l​l​V​i​e​w​ ​*​s​c​r​o​l​l​V​i​e​w​ ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.