Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS VIewController for UIScrollViews content
    text
    copied!<p>I have a <code>UIScrollView</code> in my app and I am adding some custom views from xib to it so you can horizontally scroll (tabbing) in <code>ScrollView</code> to change which one is shown. For now this works but I have a problem with connecting views to controllers. </p> <p>I don't know how to choose structure of <code>ViewControllers</code> (how many controllers should I use, use nested controllers,...).</p> <p>I have a rootView and its controller. In this rootView there is a <code>ScrollView</code> and this ScrollView contains some custom views (subviews) loaded from xib (using loadNibNamed method).</p> <p><strong>My question is</strong> should I use the same <code>ViewController</code> as for <code>rootView</code> also for these <code>subviews</code> in <code>ScrollView</code>? Problem is that the <code>ViewControllers</code> view property is already bind to the rootView (<code>super view</code> in <code>rootView</code>) so when I bind this view property also to subviews an error is occurred. Also if I create new controller for these subviews an error is occurred as well. </p> <p>When I am loading <code>subviews</code> to the <code>ScrollView</code> with <code>loadNibNamed</code> method in <code>ViewController</code> of rootView, owner of these <code>subviews</code> is <code>ViewController</code> (owner argument of <code>loadNibNamed</code> method is set to <code>self</code>). </p> <p>Can you tell me please, how should I solve this? What <code>controller</code> should I use for <code>subviews</code>, should I create new one or should I use existing one. Or should I use some nested <code>controller</code>? I am newbie in iOS development so I have a chaos in using <code>ViewControllers</code> right now...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload