0
votes

I have a ViewController1 which has a ScrollView. In that Scrollview, I am adding another ViewController2. Everything is working fine as expected. I could able to scroll the view. Here in this ViewController2, I am trying to add subview another view with separate view class initialising frame from ViewController2. When I add this, everything is visible and working fine but the view doesn't allow the scrollview to scroll.

The hierarchy is like this

UIViewController1(Root) --> UIScrollView

UIScrollView's subview --> UIViewController2

UIViewController2's subview --> UIView(separate class frame sent from UIViewController2)

Please help me on this.

1

1 Answers

0
votes

Are you sure that you are setting frames properly? Make sure that nothing is overlapping that scrollView, you can also check whether a contentSize of that scrollView requires scrolling. Those are the things I would start looking at your problem's description.

With overlapping layers you can check it on simulator (Debug option and then set Color Blended Layers)