title: Allow only 1 view controller to be in landscape or portrait
body: <p>my app is portrait what i wanna do is allow 1 view controller to be portrait or landscape i tried using this code in AppDelegate but i am getting an error </p>
  
  <pre><code>   func application(_ application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow) -&gt; Int {
  
          let currentViewController: UIViewController? = self.topView
  
  
      // Get topmost/visible view controller
      var currentViewController: UIViewController? = self.topViewController
      // Check whether it implements a dummy methods called canRotate
      if currentViewController?.responds(to: #selector(self.canRotate)) {
      // Unlock landscape view orientations for this view controller
      return .allButUpsideDown
      }
      // Only allow portrait (standard behaviour)
      return .portrait
      }
  }
  </code></pre>
  
  <p>Does anyone know how to do that in swift?</p>