Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Views and view controllers exist in pairs. Each view controller control a view and the view's subviews. This is necessary because view controllers are in the responder chain for events. If multiple view controllers are active within the same view, the responder chain becomes scrambled.</p> <p>Standard view controllers don't have a <code>subController</code> attribute and don't understand if another controller is active in the same chain. Navigation and tabbar controllers exist precisely to handle hierarchal controllers. However, they do so by swapping one view/view-controller pair for another. You can't use navigation or tabbar controllers to provide different controllers for subviews. </p> <p>So, regardless of how many subviews you may have for anyone view, you end up with just one controller per screen. </p> <p>You might want to reconsider your design. If the subviews each need highly customizable behavior, you might want to move them to individual views in a controller hierarchy such as in the master-detail design pattern. </p> <p>If you do have to have all the subviews on the same screen, then I would suggest looking at how a UITableView and UITableViewController handle things. (You might be able to just use a a modified tableview.) A tableview is a scrollview that holds multiple subviews for cells, section titles, headers and footers. It manages this by trapping the touches from the tableview and determining which cell view was touched and then taking the appropriate action.</p> <p>If you need highly customized behavior for each subview, you could use the delegate pattern and assign each subview a different delegate object. The view could trap its own touches and call its own delegate. </p> <p>Scrollviews can be tricky to implement customized touch behavior because the scrollview traps touches at a higher level than other views so that it can determine if it needs to scroll or not. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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