ole / OLEContainerScrollView

A UIScrollView subclass that intelligently handles multiple child scroll views and does not interfere with UIKitʼs cell reuse functionality.
http://oleb.net/blog/2014/05/scrollviews-inside-scrollviews/
MIT License
587 stars 67 forks source link

Why use contentView to addSubViews? #23

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, i had read you source codes, and i found that all subviews are added to a contentview, and this contentview is added to the ScrollView, then set contentview's frame and bounds to control subviews position. i just want to know why just add subviews to scrollview directly?

ole commented 6 years ago

As I said in the blog article that's linked from this repo:

I had to introduce the content view to keep the user-added subviews separate from the private subviews UIScrollView creates for its scroll indicators.