Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In cases where UISplitViewController won't cut it or you can't use it because you're on the iPhone, there are a number of different ways to do this:</p> <ol> <li>Create a parentController that alloc/inits two child viewControllers and then adds their views as subviews. This is the approach I use when I need to, but I should warn that Apple advises against it in the <a href="http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/AboutViewControllers/AboutViewControllers.html#//apple_ref/doc/uid/TP40007457-CH112-SW12" rel="nofollow"><strong>Note</strong> section of the <strong>View Controller Programming Guide</strong></a></li> <li>Create a parentController that is responsible for say the left side but it alloc/inits a child viewController that is responsible for the right side and adds its view as a subview. Same caveat as above, Apple advises against it.</li> <li>Similar to the above, but use the Apple recommended approach of having your sub controllers subclass NSObject instead of UIViewController. Here's <a href="http://blog.carbonfive.com/2011/03/09/abusing-uiviewcontrollers/" rel="nofollow">a good blog post on the subject</a>.</li> <li>Jam it all together into one monster viewController that is responsible for everything. This is the most common approach you'll find used if you're inheriting old iOS code (and in my opinion the worst).</li> </ol> <p>I personally prefer the first, second, or third approaches as it leads to better separation of concerns, good encapsulation, and therefor cleaner and easier to maintain code. I also find that later on if we change the flows to move away from a split style view to two different screens, the individual viewControllers are completely re-usable because they are well encapsulated.</p>
    singulars
    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.
    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