title: lock orientation of a viewController in swift
body: <p>I'm a newbie in Swift and i have a problem locking the orientation to portrait in a viewController. Actually i have locked it using this code in my Custom Navigation Controller</p>
  
  <pre><code>override func supportedInterfaceOrientations() -&gt; UIInterfaceOrientationMask {
      if (self.visibleViewController is ViewController)
      {
          return UIInterfaceOrientationMask.Portrait
      }
      return .All
  }
  </code></pre>
  
  <p>Everything works fine and the ViewController is locked to portrait.The problem is when return to this controller from another in landscape mode.
  if i return to ViewController (pressing back from the NextViewController) in landscape then the ViewController appeared in landscape. Any suggestion?</p>