Why I can't force UIViewController orientation on iPad to be portrait as a framework developer?

Hello, our client specified that the only available orientation for the device should be in portrait mode. It is easy to set that in the application, but I am developing a framework. This is why I add the following code to every ViewController which is available in our framework:

   override open var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return UIInterfaceOrientationMask.portrait
    }

    override open var shouldAutorotate: Bool {
        return false
    }

    override open var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
        return UIApplication.shared.statusBarOrientation
    }

The problem is that it does not work on iPad… It works well on all iphones, but does not on iPad… Maybe someone knows how to achieve desired behavior with specific ViewControllers?

@wellbranding Do you still have issues with this?

This topic was automatically closed after 166 days. New replies are no longer allowed.