title: How to disable and enable auto rotate on swift?
body: <p>On general settings I allow portrait and landscapeleft , landscaperight modes. I want to turn off landscape modes. On viewController I write this code:</p>
  
  <pre><code>override func shouldAutorotate() -&gt; Bool {
  
          return false
  
  }
  </code></pre>
  
  <p>However, the auto rotation works ignoring this function. How do I disable and enable autorotation on swift? IOS programming</p>