title: Set Orientation For Only One View Controller iOS 13 Swift
body: <p>I'm creating an iPhone-only app using the latest version of Swift and Xcode, with 3 tabBar sections in the app, and in only one tab bar I want the user to have its screen fixed to landscape. I've tried <strong>almost all possible solutions I found on StackOverflow and some other websites, all not seeming to work</strong>(including this one: <a href="https://stackoverflow.com/questions/28938660/how-to-lock-orientation-of-one-view-controller-to-portrait-mode-only-in-swift">How to lock orientation of one view controller to portrait mode only in Swift</a>). Anyone know why?</p>
  
  <p>This is the view controller of the view that I want to be fixed in landscape orientation:</p>
  
  <pre class="lang-swift prettyprint-override"><code>
  import UIKit
  @objcMembers class ViewController: UIViewController {
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          }
  
          let value = UIInterfaceOrientation.portrait.rawValue
          UIDevice.current.setValue(value, forKey: "orientation")
          themes()
      }
  
      override func viewDidAppear(_ animated: Bool) {
          super.viewDidAppear(animated)
      }
  
      //Some Code
  
  ///////////////////////////////////////
  
      override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
          return .portrait
      }
  
      override var shouldAutorotate: Bool {
          return false
      }
  ///////////////////////////////////////
  }
  
  </code></pre>