Why is my root view controller in the wrong orientation if the iPad is rotated while the modal controller is displayed?

I have a simple view controller, which is the root view controller in my UIWindow application. At some point, I have a root view controller, which is a modal view controller. Nothing special.

However, if I then rotate the device while the modal view manager is displayed, and then release this modal view controller, the original root view controller is in the wrong orientation.

Since Apple has removed the ability to set the orientation (for example, [[UIDevice currentDevice] setOrientation:myOrientation] ), I don’t understand how I can get the root view controller to be in the right orientation when I fire the modal view controller that it displays.

Any ideas? Or am I stuck in the depths of an aphorism orientation iOS?

For the record: the modal view controller is represented on the root view controller. I read somewhere that this helps - it is not.

+4
source share

Source: https://habr.com/ru/post/1382086/


All Articles