title: UIViewController containment
body: <p>I'm trying to use the UIViewController containment feature in one of my projects. The app is meant to be used in landscape mode only. </p>
  
  <p>I add UIViewController <strong>A</strong> as a child of UIViewController <strong>B</strong> and add <strong>A</strong>'s main view as a subview of one of <strong>B</strong>'s views. I'm also saving a reference to A in B:</p>
  
  <pre><code>@interface BViewController : UIViewController
  
  @property (retain, nonatomic) AViewController *aVC;
  
  @end
  
  @implementation BViewController : UIViewController
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      self.aVC = [self.storyBoard instantiateViewControllerWithIdentifier:@"A"];
      [self addChildViewController:self.aVC];
      [self.myContainerView addSubview:self.aVC.view];
  }
  
  @end
  </code></pre>
  
  <p>The problem I have is that landscape orientation is not being respected. I did some debugging and found a solution, but I fear is not ideal as it's more of a hack:</p>
  
  <p>In B:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      self.aVC = [self.storyBoard instantiateViewControllerWithIdentifier:@"A"];
      [self addChildViewController:self.aVC];
      [self.myContainerView addSubview:self.aVC.view];
      [self.aVC didMoveToParentViewController:self];
  }
  </code></pre>
  
  <p>In A:</p>
  
  <pre><code>- (void)didMoveToParentViewController:(UIViewController *)parentVC
  {
      // Interchange width and height
      self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.**height**, self.view.frame.size.**width**);
  }
  </code></pre>
  
  <p>Am I missing something here?</p>