I am working on an App where I want to show a modal view controller when the user rotates the device. It should dismiss when the user rotates it back to portrait. During the rotation, the main view controller shouldn't be rotated.
How can I manage that?
I tried putting the code into the shouldAutorotateToInterfaceOrientation:
method for showing the modal view controller, but I got always an error.
Some ideas?
In the appDelegate you could use
and define the method
In this method, fetch the new orientation and apply or remove the modal view controller.
In
shouldAutorotateToInterfaceOrientation:
limit the original view to only accept the one orientation you want it to have.