title: swift: reset screen orientation to portrait
body: <p>I used the following code to rotate a view controller to PortraitUpsideDown:</p>
  
  <pre><code>class VC : UIViewController {
  
      override func shouldAutorotate() -&gt; Bool {
  
          let value = UIInterfaceOrientation.PortraitUpsideDown.rawValue
          UIDevice.currentDevice().setValue(value, forKey: "orientation")
              return true
                  }
  
  
      override func supportedInterfaceOrientations() -&gt; Int {
          return Int(UIInterfaceOrientationMask.PortraitUpsideDown.rawValue)
      }
  </code></pre>
  
  <p>However, on the next view controller I want the screen orientation to be back to Portrait. How do I reset this?</p>
  
  <p>This didn't work:</p>
  
  <pre><code>override func shouldAutorotate() -&gt; Bool {
  
          let value = UIInterfaceOrientation.PortraitUpsideDown.rawValue
          UIDevice.currentDevice().setValue(value, forKey: "orientation")
          return false
  
      }
  </code></pre>