Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding View Controller Nesting in iOS
    primarykey
    data
    text
    <p>Ive been tearing my hair out over the last couple of days trying to understand this one seemingly basic concept of iOS development:</p> <ul> <li><p>If I want to have two or more View Controllers displayed and usable in the same "screenful", is this:</p> <ol> <li>Not advisable as per Apple's "One VC per screenful of content"</li> <li>Completely possible by adding the VC's via code</li> <li>Just not done. Instead, use one VC and simply add code that mimics the functionality of the view controllers you want.</li> </ol></li> </ul> <p>Let me rephrase a bit:</p> <p>If I wanted to have, in an iPad app, a <code>UIView</code> (A) that takes up a large portion of the left side of the screen, and a second <code>UIView</code> (B) that takes up the rest of the right side of the screen, and I wanted to add a button to <code>UIView</code> B that when clicked would use the Modal transition to slide up a <code>UITableview</code> to replace UIView B, and this <code>UITableview</code> would then act like a typical <code>UITableviewController</code> whereby when the user picks an item from the table, the typical events are sent to the tableview controller to push in a new set of items, is this possible?</p> <p>It just seems to me that if Im already able to easily create two separate UIViewControllers, and have a button in one VC modally bring up the second VC, why cant I combine this functionality so that one VC has two children VCs, and those children VCs handle their own modal transitions.</p> <p>Or is the best practice in a case like this to simply have one VC that handles everything, and then manually handle animating the slides in / out of various views after various clicks on various UI elements?</p> <p>As you can tell, I think Ive read too many different, conflicting responses to questions similar to this that Ive gotten entirely confused about whats what anymore. If anyone out there understands what Im getting at and can lend a helping explanation or some pointers Id greatly appreciate it.</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.
 

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