I'm writing a Cordova plugin, which simply presents a UIView controller. I can lock the orientation of that UIView, but can I also lock its parent's orientation?
in main Cordova class:
self.storyboard = UIStoryboard(name: "myuiview", bundle: nil)
self.myView = self.storyboard?.instantiateInitialViewController() as? myViewController
self.viewController.present(self.myView!, animated: true) { _ in }
in myViewController:
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}
This locks the orientation of current myViewController. However when I rotate the device and then dismiss
myViewController, the orientation of the app still changed