title: how to change screen orientation on new modal view controller iOS
body: <p>I have an app developed for iPhone with Xcode which diplays my view controllers in portrait mode with rotation activated.</p>
  
  <p>there's a cell in my table view  which triggers a new view controller (iPhoneSignVC) in modal mode, my question is...</p>
  
  <p>is there a way to determine my new modal view controller's orientation from the very begining?? I mean... I want my new view controller to be in landscape mode and without screen rotation feature activated on that particular viewController</p>
  
  <p>so far what I did was to create a new Class which overwrites UINavigation controller's class</p>
  
  <pre><code>#import "UINavigationController.h"
  #import "iPhoneSignVC.h"
  
  @implementation UINavigationController (overrides)
  
  - (BOOL)shouldAutorotate
  {
      id currentViewController = self.topViewController;
  
      if ([currentViewController isKindOfClass:[iPhoneSignVC class]])
          return NO;
  
  
      return YES;
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  {
      id currentViewController = self.topViewController;
  
      if ([currentViewController isKindOfClass:[iPhoneSignVC class]]){
          return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
      }
  
      return (interfaceOrientation == UIInterfaceOrientationMaskAll);
  }
  
  
  @end
  </code></pre>
  
  <p>I tried this without success...</p>
  
  <p>Thanks in advance for your support folks</p>