title: Parent UIViewController doesn't change orientation after Dismiss
body: <p>I have one <code>UIViewController</code> (called B) which I want to present (force) it in Landscape orientation. All of the other <code>UIViewControllers</code> presented in Portrait mode. In my project settings, only portrait mode is selected. 
  My problem is that when I came back from B to A. It stucks on Landscape mode. </p>
  
  <p>Inside AppDelegate:</p>
  
  <pre><code>func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -&gt; UIInterfaceOrientationMask {
      if #available(iOS 10.0, *) {
          if self.window?.rootViewController?.presentedViewController is CheckImageCameraViewController {
              return UIInterfaceOrientationMask.landscapeRight
          } else {
              return UIInterfaceOrientationMask.portrait
          }
      } else {
          // Fallback on earlier versions
      }
      return UIInterfaceOrientationMask.portrait
  }
  </code></pre>
  
  <p>In controller A;</p>
  
  <pre><code>let controllerB = ControllerB()
  self.present(controllerB,animated:true,completion:nil)
  </code></pre>
  
  <p>In Controller B;</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
  
      let value = UIInterfaceOrientation.landscapeRight.rawValue
      UIDevice.current.setValue(value, forKey: "orientation")
  }
  func closeButtonTapped(){
  self.dismiss()
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> When It is on A, If I move phone to change orientation. It looks in portrait. </p>