title: Rotation of UIPageViewController in Container View Controller
body: <p>I have a UIViewController that contains other ViewControllers. Initial ViewController is set in viewDidLoad:</p>
  
  <pre><code>FirstViewController *first = [FirstViewController alloc] init];
  first.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  first.view.frame = m_content.frame;
  
  [self addChildViewController:first];
  [m_content.view addSubview:first.view];
  [first didMoveToParentViewController:self];
  m_activeViewController = first;
  </code></pre>
  
  <p>This Container Controller has implemented <strong>automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers</strong> to return YES. It has also implemented to manualy forward rotation changes to non active ViewControllers</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      return YES;
  }
  - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
  {
      for(UIViewController *vc in m_viewControllers)
      {
          if(vc != [m_activeViewController]
              [vc willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
      }
  }
  - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
  {
      for(UIViewController *vc in m_viewControllers)
      {
          if(vc != [m_activeViewController]
              [vc didRotateFromInterfaceOrientation:fromInterfaceOrientation];
      }
  }
  </code></pre>
  
  <p>When menu button is tapped i make the transition between ViewControllers.</p>
  
  <pre><code>- (void)onMenuItemTapped:(id)sender
  {
      UIViewController *vc = [m_viewControllers objectAtIndex:sender.tag];
  
      vc.view.frame = m_content.frame;
      [self addChildViewController:vc];
      [self transitionFromViewController:m_activeViewController toViewController:vc duration:0 options:UIViewAnimationOptionTransitionNone animations:nil completion:^(BOOL finished) {
      [vc didMoveToParentViewController:self];
      [m_activeViewController removeFromParentViewController];
      m_activeViewController = vc;
      }];
  }
  </code></pre>
  
  <p>This transition works fine for my "normal" ViewControllers and they are displayed properly after orientation changes, even if they are not active. However, one of these Child View Controllers, called SecondCV, has <strong>UIPageViewController</strong> as a Child View Controller. I have <strong>UIPageViewControllerDelegate</strong> and <strong>UIPageViewControllerDataSource</strong> set to this SecondCV and in <strong>pageViewController:spineLocationForInterfaceOrientation:</strong> I return UIPageViewControllerSpineLocationMin for Portrait and UIPageViewControllerSpineLocationMid for Landscape. Rotation for this SecondVC works correctly when its active - there are two pages on the landscape and one on the portrait mode displayed correctly. But when this SecondVC is not active the rotation is incorrect. Even if <strong>pageViewController:spineLocationForInterfaceOrientation:</strong> is called, there is still one page in both Portrait and Landscape mode. I am trying to fix this for some time, but i dont see any other options. Do you have any ideas how to fix this? </p>
  
  <p>Thank you.</p>