Swift 3 - How to lock orientation for iOS app?
<p>I'm trying to create an app that only supports portrait orientation, I have tried setting at <strong>Target -> General -> Deployment Info -> Portrait</strong></p>

<p>Then, at <strong>appDelegate.swift</strong></p>

<pre><code>override func shouldAutorotate() -&gt; Bool {
        return false
    }
</code></pre>

<p>AT <strong>ViewController.swift</strong></p>

<pre><code>    override func supportedInterfaceOrientations() -&gt; UIInterfaceOrientationMask {
        return [UIInterfaceOrientationMask.Portrait ]
    }
</code></pre>

<p>But it doesn't work.. At ViewController.swift, it give me <strong>error</strong>: </p>

<blockquote>
  <p>Method does not override any method from its superclass</p>
</blockquote>