Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, you can. A few observations:</p> <ol> <li><p>All you need to do is to put in the sort of code that we used to use when using NIBs. In the case of containers, that means <a href="http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW81" rel="nofollow">the typical container methods</a>. If you've not done containment via code, see <a href="https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html" rel="nofollow">Creating Custom Container View Controllers</a> in the <em>View Controller Programming Guide.</em> Bottom line, as you transition to a non-storyboard scene (or add a non-storyboard child view controller), just code it like you always used to in the NIB-based environment. You cannot represent this NIB-based scene in the storyboard. But you just get the controller like you always do with NIBs:</p> <pre><code>SecondViewController *controller = [[SecondViewController alloc] initWithNibName:nil bundle:nil]; </code></pre></li> <li><p>You obviously lose many of the benefits of using storyboards (e.g. sizing the child scene on the basis of the container view in the parent scene), but you're no worse off than you were in a NIB environment. But in answer to your question as to whether you can "link them to the container views in the storyboard", you cannot represent this relationship in the storyboard itself, but rather you link them up programmatically.</p></li> <li><p>If your separate teams are working in single-scene environments, you can use this NIB approach. You should also contemplate, though, just having multiple storyboards, one for each logical team. You'll still have to resort to code as you transition between storyboards, just like you do in this NIB approach, but if one of your teams has multiple scenes to deal with, they can enjoy storyboard benefits within their portion of the project. When you want to get to the first scene in the next storyboard, you can:</p> <pre><code>UIStoryboard *secondaryStoryboard = [UIStoryboard storyboardWithName:@"SecondStoryboard" bundle:nil]; SecondViewController *controller = [secondaryStoryboard instantiateInitialViewController]; </code></pre></li> <li><p>If your child needs to transition to a new scene on your storyboard, I find it useful to add my own <code>parentStoryboard</code> property to my child controller, which it can then useful if you need to do something like <code>instantiateViewControllerWithIdentifier</code>. Obviously, if you're not transitioning to new controllers, you may not need to do that, but if you are, having a <code>UIStoryboard</code> property can be useful.</p></li> </ol>
    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. 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