To let users zoom in to or out of the displayed content using the pinch gesturesĪ common control used in iOS apps – UITableView – is a subclass of UIScrollView and provides a great way to view content that is larger than the screen.To let users drag the area of the content they want to display.In iOS, scroll views are used to view content that won’t fit entirely on the screen. In this tutorial, we’ll look at various aspects of UIScrollView, specifically, creating a scroll view programmatically and in Interface Builder, scrolling and zooming, working with insets and nested scroll views.īefore reading on, first download the resource file for the project which contains files we’ll use in the tutorial. Scroll views are created as any other view is, either programmatically or in Interface Builder. After reading an interesting answer describing UIScrollView's event flow, I came to the conclusion that trying to 'remote control' a scroll view from a gesture recognizer is probably very hard to achieve because touches are mutated while being routed to views and gesture recognizers. There are only two additional steps required to complete the scroll view configuration: After that, only a small amount of additional configuration is required to achieve basic scrolling capabilities.Ī scroll view is created and inserted into a controller or view hierarchy like any other view. You must set the contentSize property to the size of the scrollable content. This specifies the size of the scrollable area.