Working with scroll view
Scroll view is a subclass of UIView
that helps you add multiple views so that the sum of their height is larger than the height of super view. It lets you scroll between subview horizontally, vertically, or both at the same time; user can scroll with swipe and pan gestures. Scroll view provides the functionality to zoom its content by allowing a user to pinch zoom the content. This native component has an impressive set of APIs that provides you with flexibility and features to manage scrolling, zooming, and content size. Before getting into the UITableView
, UICollectionView
, or UITextView
native components, you have to be experienced with UIScrollView
because it is the superclass for all these views.
Getting ready
Before getting started with our example, I want to point out some properties in UIScrollView
that are used heavily while dealing with it. The following is a list of the most important properties that you should be aware of:
contentSize: It's the size of the...