title: How to force or disable interface orientation for some but not all UIViewController?
body: <p>I have an app with 9-10 screens. I embedded a <code>UINavigationController</code> into my view controller. I have few view controllers which I want set only portrait orientation: it means that rotating the device should not rotate these view controllers to landscape mode. I have tried the following solutions:</p>
  
  <p><strong>first:</strong></p>
  
  <pre><code>   NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
     [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
  </code></pre>
  
  <p>but screen still rotates to landscape.</p>
  
  <p><strong>Second:</strong>
  I created a custom view controller class as <code>PortraitViewController</code> and added the code below in <code>PortraitViewController.m</code></p>
  
  <pre><code>@interface PortraitViewController ()
  @end
  
  @implementation PortraitViewController
  - (BOOL)shouldAutorotate
  {
      return YES;
  }
  
  - (NSUInteger)supportedInterfaceOrientations
  {
      //Here check class name and then return type of orientation
      return UIInterfaceOrientationMaskPortrait;
  }
  @end
  </code></pre>
  
  <p>After that I implemented <code>PortraitViewController.h</code> as a base class</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "PortraitViewController.h"
  @interface Login : PortraitViewController
  @end
  </code></pre>
  
  <p>It does not work at all, still allows view controller to rotate in landscape mode.</p>
  
  <p>Is there any other solution i am using iOS 8 &amp; don't want viewcontroller to rotate in landscape mode?</p>
  
  <p><strong>EDIT:</strong>
  Is it possible to have Landscape orientation only for some view controllers, and force other view controllers orientation to stick to Portrait?</p>