title: Smooth animate hide and show Master View Controller in Split View Controller
body: <p>I am developing iPad application using <code>UISplitViewController</code>. I want to show/hide Master View Controller on demand. I have seen <a href="https://stackoverflow.com/questions/8020323/how-to-hide-unhide-master-view-controller-in-splitview-controller">How to hide &amp; unhide Master View Controller in SplitView Controller</a> and <a href="https://stackoverflow.com/questions/19526882/animate-visibility-of-master-detail-controller-of-uisplitviewcontroller">Animate visibility of master detail controller of UISplitViewController</a>, so I came up with something like this:</p>
  
  <p>I have <code>hideMasterView</code> <code>BOOL</code> variable in my <code>UISplitViewControllerDelegate</code> and when I want to show/hide Master View I call:</p>
  
  <pre><code>hideMasterView = !hideMasterView;
  [UIView animateWithDuration:0.25
                        delay:0.0
                      options:UIViewAnimationOptionCurveEaseInOut
                   animations:^{
                            [self.splitViewController willAnimateRotationToInterfaceOrientation:self.interfaceOrientation duration:0];
                            [self.splitViewController willRotateToInterfaceOrientation:self.interfaceOrientation duration:0];
                            [self.splitViewController didRotateFromInterfaceOrientation:self.interfaceOrientation];
                            [self.splitViewController viewWillLayoutSubviews];
                            [self.splitViewController.view layoutSubviews];
                        }
                   completion:^(BOOL finished) {}];
  </code></pre>
  
  <p>And my delegate has method:</p>
  
  <pre><code>- (BOOL)splitViewController:(UISplitViewController *)svc
     shouldHideViewController:(UIViewController *)vc
                inOrientation:(UIInterfaceOrientation)orientation{
      return hideMasterView;
  }
  </code></pre>
  
  <p>It works, but animation is not quite smooth. On hide everything works fine, but <strong>when Master View is being shown, Detail View is resized before sliding, leaving blank gray space on right and sliding on it afterwards</strong>.</p>
  
  <p>How to fix this animation?</p>