title: How to hide a UIView completely when changing orientation?
body: <p>I want to design a view/view controler that automaticaly shows/hides a subview when in landscape orientation. I want the subview to dissapear completely and other subviews to take up its space.</p>
  
  <p>Using a UIViewController, I wrote code that sets the subviews' frame property and call it on:</p>
  
  <pre><code>- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration;
  </code></pre>
  
  <p>This solves the problem most of the times but has problems when the orientation change is happening when the view is not appearing.
  to bypass this, I am also calling the resizing method on:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated;
  </code></pre>
  
  <p>but this has problems in some rare cases (involving a UISearchDisplayController) so I am also calling the resizing method on </p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated;
  </code></pre>
  
  <p>As you can understand, I am unhappy with this code and I am looking for a better/more performant way to do this.</p>
  
  <p>Any ideas?</p>